﻿<UserControl
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
   xmlns:Microsoft.FamilyShowLib="clr-namespace:Microsoft.FamilyShowLib;assembly=FamilyShowLib"
   xmlns:local="clr-namespace:Microsoft.FamilyShow"
   xmlns:sys="clr-namespace:System;assembly=mscorlib"
   xmlns:properties="clr-namespace:Microsoft.FamilyShow.Properties"
   x:Class="Microsoft.FamilyShow.Details" DataContextChanged="UserControl_DataContextChanged" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" Width="277" >
    <UserControl.Resources>

        <ResourceDictionary>

            <!-- Converter for formatting dates to short date format -->
            <local:DateFormattingConverter x:Key="DateFormattingConverter"/>
            
            <!-- Converter for coverting enum values to bool -->
            <local:EnumToBoolConverter x:Key="EnumToBoolConverter"/>

            <local:EnumValueDescriptionConverter x:Key="EnumValueDescriptionConverter"/>
           
            <!-- Converter for displaying the the first name with an apostrophe. -->
            <local:FirstNamePossessiveFormConverter x:Key="FirstNamePossessiveFormConverter"/>

            <!-- Converter for showing/hiding features based on boolean property -->
            <local:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
            
            <!-- Converter for showing/hiding features based on boolean property -->
            <local:NotBoolToVisibilityConverter x:Key="NotBoolToVisibilityConverter"/>

            <!-- Converter for disabling the death related textboxes -->
            <local:NotConverter x:Key="NotConverter"/>

            <!-- Converter for showing/hiding the parents, spouses, and avatar section -->
            <local:ComposingConverter x:Key="ComposingConverter">
                <local:ComposingConverter.Converters>
                    <local:NotConverter/>
                    <local:BoolToVisibilityConverter/>
                </local:ComposingConverter.Converters>
            </local:ComposingConverter>

            <local:ImageConverter x:Key="ImageConverter"/>

            <!-- Data provider for binding to the relationship types enum values -->
            <ObjectDataProvider x:Key="RelationshipValuesEnumDS" ObjectType="{x:Type sys:Enum}" MethodName="GetValues">
                <ObjectDataProvider.MethodParameters>
                    <x:Type TypeName="local:FamilyMemberComboBoxValue" />
                </ObjectDataProvider.MethodParameters>
            </ObjectDataProvider>
            
            <!-- Data provider for binding to the citation types enum values -->
            <ObjectDataProvider x:Key="CitationValuesEnumDS" ObjectType="{x:Type sys:Enum}" MethodName="GetValues">
                <ObjectDataProvider.MethodParameters>
                    <x:Type TypeName="local:CitationsComboBoxValue" />
                </ObjectDataProvider.MethodParameters>
            </ObjectDataProvider>
            
            <!-- Data provider for binding to the relationship citation types enum values -->
            <ObjectDataProvider x:Key="RCitationValuesEnumDS" ObjectType="{x:Type sys:Enum}" MethodName="GetValues">
                <ObjectDataProvider.MethodParameters>
                    <x:Type TypeName="local:RCitationsComboBoxValue" />
                </ObjectDataProvider.MethodParameters>
            </ObjectDataProvider>
            
            <!-- Data provider for binding to the existing relationship types enum values -->
            <ObjectDataProvider x:Key="ExistingRelationshipValuesEnumDS" ObjectType="{x:Type sys:Enum}" MethodName="GetValues">
                <ObjectDataProvider.MethodParameters>
                    <x:Type TypeName="local:ExistingFamilyMemberComboBoxValue" />
                </ObjectDataProvider.MethodParameters>
            </ObjectDataProvider>

            <!-- Data provider for binding to the spouse modifier enum values -->
            <ObjectDataProvider x:Key="SpouseStatusEnumDS" ObjectType="{x:Type sys:Enum}" MethodName="GetValues"> 
                <ObjectDataProvider.MethodParameters>
                    <x:Type TypeName="Microsoft.FamilyShowLib:SpouseModifier"  />
                </ObjectDataProvider.MethodParameters>
            </ObjectDataProvider>

            <!-- Data provider for binding to the parent child modifier enum values -->
            <ObjectDataProvider x:Key="ParentChildEnumDS" ObjectType="{x:Type sys:Enum}" MethodName="GetValues">
                <ObjectDataProvider.MethodParameters>
                    <x:Type TypeName="Microsoft.FamilyShowLib:ParentChildModifier" />
                </ObjectDataProvider.MethodParameters>
            </ObjectDataProvider>

            <!-- Data provider for binding to the gender types enum values -->
            <ObjectDataProvider x:Key="GenderEnumDS" ObjectType="{x:Type sys:Enum}" MethodName="GetValues">
                <ObjectDataProvider.MethodParameters>
                    <x:Type TypeName="Microsoft.FamilyShowLib:Gender" />
                </ObjectDataProvider.MethodParameters>
            </ObjectDataProvider>
            
            <!-- Data provider for binding to the restriction types enum values -->
            <ObjectDataProvider x:Key="RestrictionEnumDS" ObjectType="{x:Type sys:Enum}" MethodName="GetValues">
                <ObjectDataProvider.MethodParameters>
                    <x:Type TypeName="Microsoft.FamilyShowLib:Restriction" />
                </ObjectDataProvider.MethodParameters>
            </ObjectDataProvider>

            <!-- Data Template for displaying the parent set -->
            <DataTemplate x:Key="ParentSetTemplate">
                <TextBlock Text="{Binding Path=Name, Mode=Default}"/>
            </DataTemplate>
            
            <!-- Data Template for displaying the attachments -->
            <DataTemplate x:Key="AttachmentSetTemplate">
                <TextBlock Text="{Binding Path=FileName, Mode=Default}"/>
            </DataTemplate>
            
            <!-- Animation for expanding the Details Add section -->
            <Storyboard x:Key="ExpandDetailsAdd" Completed="ExpandDetailsAdd_StoryboardCompleted">
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsAdd" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="300"/>
                </DoubleAnimationUsingKeyFrames>
                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsAdd" Storyboard.TargetProperty="(UIElement.Visibility)">
                    <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                    <DiscreteObjectKeyFrame KeyTime="00:00:00.3000000" Value="{x:Static Visibility.Visible}"/>
                </ObjectAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsInfo" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="315"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
                </DoubleAnimationUsingKeyFrames>

                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsInfo" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0.2"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsList" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0.2"/>
                </DoubleAnimationUsingKeyFrames>

                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyDataButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditCitationsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditRelationshipsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="InfoButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="EditAttachmentsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="EditButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyMemberAddButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="AddButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00.3000000" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                
            </Storyboard>

            <!-- Animation for collapsing the Details Add section -->
            <Storyboard x:Key="CollapseDetailsAdd" Completed="CollapseDetailsAdd_StoryboardCompleted">
                
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="AddButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00.3000000" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="DetailsAdd">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="315"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsAdd" Storyboard.TargetProperty="(UIElement.Visibility)">
                    <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                    <DiscreteObjectKeyFrame KeyTime="00:00:00.3000000" Value="{x:Static Visibility.Collapsed}"/>
                </ObjectAnimationUsingKeyFrames>
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="DetailsInfo">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="315"/>
                </DoubleAnimationUsingKeyFrames>
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsInfo" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.2"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DetailsList">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.2"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
                </DoubleAnimationUsingKeyFrames>

                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyDataButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditCitationsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditRelationshipsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="InfoButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="EditAttachmentsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="EditButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyMemberAddButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                
            </Storyboard>

            <!-- Animation for expanding the Details Edit section -->
            <Storyboard x:Key="ExpandDetailsEdit" Completed="ExpandDetailsEdit_StoryboardCompleted">
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsEdit" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="555"/>
                </DoubleAnimationUsingKeyFrames>
                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsEdit" Storyboard.TargetProperty="(UIElement.Visibility)">
                    <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                    <DiscreteObjectKeyFrame KeyTime="00:00:00.3000000" Value="{x:Static Visibility.Visible}"/>
                </ObjectAnimationUsingKeyFrames>
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsInfo" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="315"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                   
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsList" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0.2"/>
                </DoubleAnimationUsingKeyFrames>
               
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DoneEditButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00.3000000" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="EditMoreButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>

                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyDataButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditCitationsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditRelationshipsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="InfoButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditAttachmentsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyMemberAddButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>

            </Storyboard>

            <!-- Animation for collapsing the Details Edit section -->
            <Storyboard x:Key="CollapseDetailsEdit" Completed="CollapseDetailsEdit_StoryboardCompleted">
                
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DoneEditButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditMoreButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="DetailsEdit">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="555"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="DetailsInfo">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="315"/>
                </DoubleAnimationUsingKeyFrames>
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsList" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.2"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
                </DoubleAnimationUsingKeyFrames>

                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditCitationsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditRelationshipsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="InfoButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="EditAttachmentsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="EditButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyDataButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyMemberAddButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                
            </Storyboard>

            <!-- Animation for expanding the Details Edit More section -->
            <Storyboard x:Key="ExpandDetailsEditMore" Completed="ExpandDetailsEditMore_StoryboardCompleted">

                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsEditMore" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="555"/>
                </DoubleAnimationUsingKeyFrames>
                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsEditMore" Storyboard.TargetProperty="(UIElement.Visibility)">
                    <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                    <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                </ObjectAnimationUsingKeyFrames>
               
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsEdit" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="555"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsEdit" Storyboard.TargetProperty="(UIElement.Visibility)">
                    <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                    <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                </ObjectAnimationUsingKeyFrames>

                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsInfo" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="315"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsList" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.2"/>
                </DoubleAnimationUsingKeyFrames>
                
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DoneEditButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditMoreButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>       
                
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DoneEditMoreButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>

                
            </Storyboard>

            <!-- Animation for collapsing the Details Edit More section -->
            <Storyboard x:Key="CollapseDetailsEditMore" Completed="CollapseDetailsEditMore_StoryboardCompleted">
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="DetailsEditMore">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="555"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                </DoubleAnimationUsingKeyFrames>

                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsEdit" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="555"/>
                </DoubleAnimationUsingKeyFrames>

                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsEdit" Storyboard.TargetProperty="(UIElement.Visibility)">
                    <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                    <DiscreteObjectKeyFrame KeyTime="00:00:00.3000000" Value="{x:Static Visibility.Visible}"/>
                </ObjectAnimationUsingKeyFrames>

                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsList" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.2"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
                </DoubleAnimationUsingKeyFrames>
                    
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="EditMoreButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DoneEditButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DoneEditMoreButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                
            </Storyboard>

            <!-- Animation for expanding the Details Edit Citations section -->
            <Storyboard x:Key="ExpandDetailsEditCitations" Completed="ExpandDetailsEditCitations_StoryboardCompleted">
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsEditCitations" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="555"/>
                </DoubleAnimationUsingKeyFrames>
                
                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsEditCitations" Storyboard.TargetProperty="(UIElement.Visibility)">
                    <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                    <DiscreteObjectKeyFrame KeyTime="00:00:00.3000000" Value="{x:Static Visibility.Visible}"/>
                </ObjectAnimationUsingKeyFrames>
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsInfo" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="315"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
   
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsList" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0.2"/>
                </DoubleAnimationUsingKeyFrames>
                
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyDataButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditCitationsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditRelationshipsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="InfoButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="EditAttachmentsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="EditButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyMemberAddButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>

                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DoneEditCitationsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00.5000000" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ExportCitationsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00.3000000" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                
            </Storyboard>

            <!-- Animation for collapsing the Details Edit Citations section -->
            <Storyboard x:Key="CollapseDetailsEditCitations" Completed="CollapseDetailsEditCitations_StoryboardCompleted">
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="DetailsEditCitations">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="555"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="DetailsInfo">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="315"/>
                </DoubleAnimationUsingKeyFrames>
                 
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsList" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.2"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
                </DoubleAnimationUsingKeyFrames>
                
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyDataButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditRelationshipsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditAttachmentsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyMemberAddButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="EditCitationsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="InfoButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DoneEditCitationsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ExportCitationsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00.3000000" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
            </Storyboard>

            <!-- Animation for expanding the Details Edit Attachments section -->
            <Storyboard x:Key="ExpandDetailsEditAttachments" Completed="ExpandDetailsEditAttachments_StoryboardCompleted">
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsEditAttachments" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="400"/>
                </DoubleAnimationUsingKeyFrames>
                
                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsEditAttachments" Storyboard.TargetProperty="(UIElement.Visibility)">
                    <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                    <DiscreteObjectKeyFrame KeyTime="00:00:00.3000000" Value="{x:Static Visibility.Visible}"/>
                </ObjectAnimationUsingKeyFrames>
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsInfo" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="315"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsList" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0.2"/>
                </DoubleAnimationUsingKeyFrames>

                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditCitationsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditRelationshipsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="InfoButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="EditAttachmentsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="EditButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyDataButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyMemberAddButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                
                
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="AddAttachment" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00.3000000" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DeleteAttachment" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00.3000000" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="OpenAttachment" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00.3000000" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LinkAttachment" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00.3000000" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DoneEditAttachmentsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00.3000000" Value="True"/>
                </BooleanAnimationUsingKeyFrames>

            </Storyboard>

            <!-- Animation for collapsing the Details Edit Attachments section -->
            <Storyboard x:Key="CollapseDetailsEditAttachments" Completed="CollapseDetailsEditAttachments_StoryboardCompleted">
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="DetailsEditAttachments">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="400"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="DetailsInfo">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="315"/>
                </DoubleAnimationUsingKeyFrames>

                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsList" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.2"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
                </DoubleAnimationUsingKeyFrames>
                
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyDataButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditRelationshipsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditAttachmentsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditCitationsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyMemberAddButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="InfoButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                

                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DoneEditAttachmentsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="AddAttachment" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00.3000000" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DeleteAttachment" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00.3000000" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="OpenAttachment" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00.3000000" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LinkAttachment" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00.3000000" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                
            </Storyboard>

            <!-- Animation for expanding the Details Edit Relationship section -->
            <Storyboard x:Key="ExpandDetailsEditRelationship" Completed="ExpandDetailsEditRelationship_StoryboardCompleted">

                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsEditRelationship" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="555"/>
                </DoubleAnimationUsingKeyFrames>

                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsEditRelationship" Storyboard.TargetProperty="(UIElement.Visibility)">
                    <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                    <DiscreteObjectKeyFrame KeyTime="00:00:00.3000000" Value="{x:Static Visibility.Visible}"/>
                </ObjectAnimationUsingKeyFrames>

                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsInfo" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="315"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
                </DoubleAnimationUsingKeyFrames>

                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsList" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0.2"/>
                </DoubleAnimationUsingKeyFrames>

                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyDataButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditRelationshipsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditCitationsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditAttachmentsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>   
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyMemberAddButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="InfoButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>

                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DoneEditRelationshipButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>

            </Storyboard>

            <!-- Animation for collapsing the Details Edit Relationship section -->
            <Storyboard x:Key="CollapseDetailsEditRelationship" Completed="CollapseDetailsEditRelationship_StoryboardCompleted">
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsEditRelationship" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="555"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
    
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="DetailsInfo">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="315"/>
                </DoubleAnimationUsingKeyFrames>
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsList" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.2"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
                </DoubleAnimationUsingKeyFrames>
                
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyDataButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditRelationshipsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditCitationsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditAttachmentsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyMemberAddButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="InfoButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DoneEditRelationshipButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>

            </Storyboard>

            <!-- Animation for expanding the Details Add Intermediate section -->
            <Storyboard x:Key="ExpandDetailsAddIntermediate" Completed="ExpandDetailsAddIntermediate_StoryboardCompleted">
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsInfo" Storyboard.TargetProperty="(UIElement.Opacity)" Duration="00:00:00.0010000">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.2"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsList" Storyboard.TargetProperty="(UIElement.Opacity)" Duration="00:00:00.0010000">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.2"/>
                </DoubleAnimationUsingKeyFrames>
                
                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DetailsAddIntermediate" Storyboard.TargetProperty="(UIElement.Visibility)">
                    <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                </ObjectAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsAddIntermediate" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="200"/>
                </DoubleAnimationUsingKeyFrames>
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsAdd" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="300"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
                </DoubleAnimationUsingKeyFrames> 
                
               <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyDataButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditRelationshipsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditCitationsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditAttachmentsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyMemberAddButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames> 
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="InfoButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="IntermediateAddButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>

            </Storyboard>

            <!-- Animation for collapsing the Details Add Intermediate section -->
            <Storyboard x:Key="CollapseDetailsAddIntermediate" Completed="CollapseDetailsAddIntermediate_StoryboardCompleted">
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="DetailsInfo">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="315"/>
                </DoubleAnimationUsingKeyFrames>
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsInfo" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.2"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
                </DoubleAnimationUsingKeyFrames>  
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DetailsList">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.2"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
                </DoubleAnimationUsingKeyFrames>

                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsAddIntermediate" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="200"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditRelationshipsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditCitationsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditAttachmentsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyMemberAddButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="InfoButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="FamilyDataButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>

                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="IntermediateAddButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                
            </Storyboard>
            
            <!-- Animation for expanding the Add Existing section -->
            <Storyboard x:Key="ExpandAddExisting" Completed="ExpandAddExisting_StoryboardCompleted">
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="AddExisting" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="555" />
                </DoubleAnimationUsingKeyFrames>
                
                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="AddExisting" Storyboard.TargetProperty="(UIElement.Visibility)">
                    <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}" />
                </ObjectAnimationUsingKeyFrames>
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsInfo" Storyboard.TargetProperty="(FrameworkElement.Height)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
                </DoubleAnimationUsingKeyFrames>
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsList" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.2" />
                </DoubleAnimationUsingKeyFrames>
                
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyDataButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditCitationsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditRelationshipsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="InfoButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditAttachmentsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyMemberAddButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="AddExistingButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
      
            </Storyboard>
            
            <!-- Animation for collapsing the Add Existing section -->
            <Storyboard x:Key="CollapseAddExisting" Completed="CollapseAddExisting_StoryboardCompleted">
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="AddExisting">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
                </DoubleAnimationUsingKeyFrames>
                
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="DetailsInfo">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="315" />
                </DoubleAnimationUsingKeyFrames>

                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DetailsList" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                </DoubleAnimationUsingKeyFrames>
                
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyDataButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditCitationsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditRelationshipsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="InfoButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="EditAttachmentsButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="EditButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FamilyMemberAddButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True"/>
                </BooleanAnimationUsingKeyFrames>
                
                <BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddExistingButton" Storyboard.TargetProperty="(UIElement.IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False"/>
                </BooleanAnimationUsingKeyFrames>
                
            </Storyboard>
            
            <ControlTemplate x:Key="LabelControlTemplate" TargetType="{x:Type Label}">
                <Border SnapsToDevicePixels="True" Margin="0,0,0,3" Background="{TemplateBinding Background}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1" Padding="{TemplateBinding Padding}">
                    <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" RecognizesAccessKey="True"/>
                </Border>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsEnabled" Value="False">
                        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>

            <Storyboard x:Key="NoPhoto_MouseEnter">
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="NoPhotoRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.5"/>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Key="NoPhoto_MouseLeave">
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="NoPhotoRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>

            <Microsoft.FamilyShowLib:Person x:Key="person"/>

            <ControlTemplate x:Key="TextBoxErrorTemplate">
                <!-- Visibility binding is used in this instance to hide the error adorner when the adorned element is not visible -->
                <DockPanel Visibility="{Binding Path=AdornedElement.IsVisible, Converter={StaticResource BoolToVisibilityConverter}, ElementName=adornedElementPlaceholder}">
                    <!-- Display the error text as tooltip -->
                    <Rectangle DockPanel.Dock="Top" HorizontalAlignment="Right" Height="12" Width="12" Margin="0,0,0,5" Fill="{StaticResource ErrorIcon}" ToolTip="{Binding Path=AdornedElement.(Validation.Errors)[0].ErrorContent, ElementName=adornedElementPlaceholder}"/>
                    <Border BorderBrush="Red" BorderThickness="1">
                        <AdornedElementPlaceholder x:Name="adornedElementPlaceholder" />
                    </Border>
                </DockPanel>
            </ControlTemplate>

            <SolidColorBrush x:Key="WindowBackgroundBrush" Color="#FFF" />
            <SolidColorBrush x:Key="SolidBorderBrush" Color="#888" />
            <SolidColorBrush x:Key="DisabledForegroundBrush" Color="#FFF" />
            <SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#EEE" />
            <SolidColorBrush x:Key="DisabledBorderBrush" Color="#AAA" />
            
       

            <!-- This is the default style for all textboxes in this user control -->
            <Style TargetType="{x:Type TextBox}" BasedOn="{x:Null}">
                <Setter Property="SnapsToDevicePixels" Value="True"/>
                <Setter Property="OverridesDefaultStyle" Value="True"/>
                <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
                <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
                <Setter Property="MinWidth" Value="120"/>
                <Setter Property="MinHeight" Value="20"/>
                <Setter Property="AllowDrop" Value="true"/>
                <Setter Property="Validation.ErrorTemplate" Value="{StaticResource TextBoxErrorTemplate}"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type TextBoxBase}">
                            <Border 
                  x:Name="Border"
                  CornerRadius="2" 
                  Padding="2"
                  Background="{StaticResource WindowBackgroundBrush}"
                  BorderBrush="{StaticResource SolidBorderBrush}"
                  BorderThickness="1" >
                                <ScrollViewer Margin="0" x:Name="PART_ContentHost"/>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsEnabled" Value="False">
                                    <Setter TargetName="Border" Property="Background" Value="{DynamicResource InputBackgroundBrush}"/>
                                    <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}"/>
                                    <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="DetailsSeparatorStyle" TargetType="{x:Type Separator}">
                <Setter Property="Background" Value="#FF6573A0"/>
                <Setter Property="Margin" Value="10,5,10,5"/>
                <Setter Property="Focusable" Value="false"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Separator}">
                            <Border SnapsToDevicePixels="true" Height="2" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"/>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <DataTemplate x:Key="ExistPersonTemplate">
                <DataTemplate.Resources>
                    <Style TargetType="{x:Type TextBlock}">
                        <Setter Property="Foreground" Value="#FF1F3066" />
                    </Style>
                </DataTemplate.Resources>
                <HeaderedItemsControl Header="{Binding Path=Name}" Foreground="#FF1F3066" Margin="5,5,5,5">
                    <TextBlock TextTrimming="CharacterEllipsis" MaxWidth="200" MaxHeight="20"  LineStackingStrategy="MaxHeight" x:Name="Name" Text="{Binding Path=FullName}" FontWeight="Bold" TextWrapping="Wrap" Margin="-7,0,7,5" />
                    <TextBlock x:Name="BirthDatePanel" Text="{Binding Path=BirthDateAndPlace}" TextWrapping="Wrap" Margin="0,0,0,5" />
                    <TextBlock TextWrapping="Wrap" x:Name="ParentsDatePanel" Margin="0,0,0,5"><Run local:BindableExtender.BindableText="{Binding Path=ParentRelationshipText}"/><Run local:BindableExtender.BindableText="{Binding Path=ParentsText}" /></TextBlock>
                    <TextBlock TextWrapping="Wrap" x:Name="SiblingsDatePanel" Margin="0,0,0,5"><Run local:BindableExtender.BindableText="{Binding Path=SiblingRelationshipText}"/><Run local:BindableExtender.BindableText="{Binding Path=SiblingsText}" /></TextBlock>
                    <TextBlock TextWrapping="Wrap" x:Name="SpousesDatePanel" Margin="0,0,0,5"><Run local:BindableExtender.BindableText="{Binding Path=SpouseRelationshipText}" /><Run local:BindableExtender.BindableText="{Binding Path=SpousesText}" /></TextBlock>
                    <TextBlock TextWrapping="Wrap" x:Name="ChildrenDatePanel" Margin="0,0,0,5"><Run local:BindableExtender.BindableText="{Binding Path=ChildRelationshipText}" /><Run local:BindableExtender.BindableText="{Binding Path=ChildrenText}" /></TextBlock>
                </HeaderedItemsControl>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding Path=BirthDate}" Value="{x:Null}">
                        <Setter TargetName="BirthDatePanel" Property="Visibility" Value="Collapsed" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding Path=Parents.Count}" Value="0">
                        <Setter TargetName="ParentsDatePanel" Property="Visibility" Value="Collapsed" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding Path=Siblings.Count}" Value="0">
                        <Setter TargetName="SiblingsDatePanel" Property="Visibility" Value="Collapsed" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding Path=Spouses.Count}" Value="0">
                        <Setter TargetName="SpousesDatePanel" Property="Visibility" Value="Collapsed" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding Path=Children.Count}" Value="0">
                        <Setter TargetName="ChildrenDatePanel" Property="Visibility" Value="Collapsed" />
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <Style x:Key="HeaderedItemsControlStyle" TargetType="{x:Type HeaderedItemsControl}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type HeaderedItemsControl}">
                            <StackPanel>
                                <Grid>
                                    <Rectangle Fill="{TemplateBinding Background}" />
                                    <ContentPresenter ContentSource="Header" />
                                </Grid>
                                <Grid>
                                    <Rectangle Stroke="{TemplateBinding BorderBrush}" />
                                    <ItemsPresenter Margin="15,0,0,0" />
                                </Grid>
                            </StackPanel>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <DataTemplate x:Key="FamilyMemberDataTemplate">
                <StackPanel x:Name="panel" RenderTransformOrigin="0.5,0.5">
                    <StackPanel.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform ScaleX="1" ScaleY="1" />
                            <SkewTransform AngleX="0" AngleY="0" />
                            <RotateTransform Angle="0" />
                            <TranslateTransform X="15" Y="0" />
                        </TransformGroup>
                    </StackPanel.RenderTransform>
                    <Separator x:Name="separator" Visibility="Collapsed" />
                    <DockPanel>
                        <TextBlock x:Name="text" Text="{Binding}" TextWrapping="Wrap" />
                        <TextBlock Text="..." TextWrapping="Wrap" />
                    </DockPanel>
                </StackPanel>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding}" Value="Existing">
                        <Setter Property="Visibility" Value="Visible" TargetName="separator" />
                        <Setter Property="Text" Value="{x:Static properties:Resources.ConnectFamilyMember}" TargetName="text" />
                        <Setter Property="RenderTransform" TargetName="panel">
                            <Setter.Value>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="1" ScaleY="1" />
                                    <SkewTransform AngleX="0" AngleY="0" />
                                    <RotateTransform Angle="0" />
                                    <TranslateTransform X="0" Y="0" />
                                </TransformGroup>
                            </Setter.Value>
                        </Setter>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding}" Value="Father">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Father}" TargetName="text" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding}" Value="Mother">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Mother}" TargetName="text" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding}" Value="Brother">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Brother}" TargetName="text" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding}" Value="Sister">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Sister}" TargetName="text" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding}" Value="Daughter">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Daughter}" TargetName="text" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding}" Value="Son">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Son}" TargetName="text" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding}" Value="Unrelated">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Unrelated}" TargetName="text" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding}" Value="Spouse">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Spouse}" TargetName="text" />
                    </DataTrigger>
                    
                    
                </DataTemplate.Triggers>
            </DataTemplate>

            <DataTemplate x:Key="ExistingFamilyMemberDataTemplate">
                <StackPanel x:Name="panel" Margin="0,0,0,0">
                    <TextBlock x:Name="text" Text="{Binding}" TextWrapping="NoWrap" />
                </StackPanel>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding}" Value="Existing">
                        <Setter Property="Visibility" Value="Collapsed" TargetName="panel" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding}" Value="Father">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Father}" TargetName="text" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding}" Value="Mother">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Mother}" TargetName="text" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding}" Value="Brother">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Brother}" TargetName="text" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding}" Value="Sister">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Sister}" TargetName="text" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding}" Value="Daughter">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Daughter}" TargetName="text" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding}" Value="Son">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Son}" TargetName="text" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding}" Value="Unrelated">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Unrelated}" TargetName="text" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding}" Value="Spouse">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Spouse}" TargetName="text" />
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>
            
            <DataTemplate x:Key="RelationshipCitationDataTemplate">
                <StackPanel x:Name="panel" Margin="0,0,0,0">
                    <TextBlock x:Name="text" Text="{Binding}" TextWrapping="Wrap" />
                </StackPanel>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding}" Value="Marriage">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Marriage}" TargetName="text" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding}" Value="Divorce">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Divorce}" TargetName="text" />
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            
            <DataTemplate x:Key="CitationDataTemplate">
                <StackPanel x:Name="panel" Margin="0,0,0,0">
                    <TextBlock x:Name="text" Text="{Binding}" TextWrapping="Wrap" />
                </StackPanel>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding}" Value="Death">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Death}" TargetName="text" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding}" Value="Birth">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Birth}" TargetName="text" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding}" Value="Cremation">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Cremation}" TargetName="text" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding}" Value="Burial">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Burial}" TargetName="text" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding}" Value="Education">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Education}" TargetName="text" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding}" Value="Religion">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Religion}" TargetName="text" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding}" Value="Unrelated">
                        <Setter Property="Text" Value="{x:Static properties:Resources.Occupation}" TargetName="text" />
                    </DataTrigger>
                   
                </DataTemplate.Triggers>
            </DataTemplate>

            <Style x:Key="ExistingPeopleListBoxStyle" TargetType="{x:Type ListBox}">
                <Setter Property="SnapsToDevicePixels" Value="true" />
                <Setter Property="OverridesDefaultStyle" Value="true" />
                <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
                <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
                <Setter Property="ScrollViewer.CanContentScroll" Value="true" />
                <Setter Property="MinWidth" Value="120" />
                <Setter Property="MinHeight" Value="95" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ListBox}">
                            <Border x:Name="Border" Background="#90FFFFFF" BorderBrush="{StaticResource SolidBorderBrush}" BorderThickness="0,0,0,0" CornerRadius="5,5,5,5">
                                <ScrollViewer Margin="0" Focusable="false">
                                    <StackPanel Margin="2" IsItemsHost="True" />
                                </ScrollViewer>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsEnabled" Value="false">

                                    <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                                    <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
                                </Trigger>
                                <Trigger Property="IsGrouping" Value="true">
                                    <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="ExistingPeopleListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
                <Setter Property="SnapsToDevicePixels" Value="true" />
                <Setter Property="OverridesDefaultStyle" Value="true" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ListBoxItem}">
                            <Border x:Name="Border" Padding="2" SnapsToDevicePixels="true">
                                <ContentPresenter />
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsSelected" Value="true">
                                    <Setter Property="Background" TargetName="Border" Value="{DynamicResource FamilyEditListViewSelectedBrush}"/>
                                </Trigger>
                                <Trigger Property="IsEnabled" Value="false">
                                    <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </ResourceDictionary>
    </UserControl.Resources>

    <UserControl.Triggers>
        <EventTrigger RoutedEvent="ButtonBase.Click" SourceName="FamilyMemberAddButton">
            <BeginStoryboard Storyboard="{StaticResource ExpandDetailsAdd}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="ButtonBase.Click" SourceName="CloseButton">
            <BeginStoryboard Storyboard="{StaticResource CollapseDetailsAdd}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="ButtonBase.Click" SourceName="CancelAddExistingButton">
            <BeginStoryboard Storyboard="{StaticResource CollapseAddExisting}" />
        </EventTrigger>
        <EventTrigger RoutedEvent="ButtonBase.Click" SourceName="EditButton">
            <BeginStoryboard Storyboard="{StaticResource ExpandDetailsEdit}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="ButtonBase.Click" SourceName="EditMoreButton">
            <BeginStoryboard Storyboard="{StaticResource ExpandDetailsEditMore}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="ButtonBase.Click" SourceName="DoneEditButton">
            <BeginStoryboard Storyboard="{StaticResource CollapseDetailsEdit}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="ButtonBase.Click" SourceName="DoneEditMoreButton">
            <BeginStoryboard Storyboard="{StaticResource CollapseDetailsEditMore}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="ButtonBase.Click" SourceName="EditCitationsButton">
            <BeginStoryboard Storyboard="{StaticResource ExpandDetailsEditCitations}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="ButtonBase.Click" SourceName="DoneEditCitationsButton">
            <BeginStoryboard Storyboard="{StaticResource CollapseDetailsEditCitations}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="ButtonBase.Click" SourceName="EditAttachmentsButton">
            <BeginStoryboard Storyboard="{StaticResource ExpandDetailsEditAttachments}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="ButtonBase.Click" SourceName="DoneEditAttachmentsButton">
            <BeginStoryboard Storyboard="{StaticResource CollapseDetailsEditAttachments}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="ButtonBase.Click" SourceName="EditRelationshipsButton">
            <BeginStoryboard Storyboard="{StaticResource ExpandDetailsEditRelationship}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="ButtonBase.Click" SourceName="DoneEditRelationshipButton">
            <BeginStoryboard Storyboard="{StaticResource CollapseDetailsEditRelationship}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="ButtonBase.Click" SourceName="IntermediateCloseButton">
            <BeginStoryboard Storyboard="{StaticResource CollapseDetailsAddIntermediate}"/>
        </EventTrigger>

    </UserControl.Triggers>
        <DockPanel>
        <!-- Details Header -->
        <Border DockPanel.Dock="Top" Background="{DynamicResource BackgroundBrush}" BorderThickness="1,1,1,0" CornerRadius="10,10,0,0" BorderBrush="{DynamicResource BorderBrush}">
            <DockPanel Height="30">
                <!-- Star -->
                <Path StrokeThickness="1.500000" Stroke="#ffffffff" StrokeMiterLimit="1.000000" Fill="{DynamicResource PrimaryStarBrush}" Data="F1 M 9.816406,1.694336 L 12.351074,6.830078 L 18.018066,7.654297 L 13.918457,11.654297 L 14.886230,17.299805 L 9.816406,14.630859 L 4.746094,17.299805 L 5.713867,11.654297 L 1.611328,7.654297 L 7.281250,6.830078 L 9.816406,1.694336 Z" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center"/>
              
                <Button  Style="{DynamicResource NormalButtonStyle}"  x:Name="Next" Height="15"   Content=">" HorizontalAlignment="Right" DockPanel.Dock="Right" Margin="0,0,12,0" Width="18"  Click="Next_Click" FontSize="10"/>
                <Button  Style="{DynamicResource NormalButtonStyle}"  x:Name="Previous" Height="15"   Content="&lt;" HorizontalAlignment="Right" DockPanel.Dock="Right" Margin="0,0,5,0" Width="18"  Click="Previous_Click" FontSize="10"/>
                <Button MinWidth="45" Width="Auto" x:Name="DeleteButton" Content="{x:Static properties:Resources.Delete}" FontSize="10" Height="15" Click="DeleteButton_Click" HorizontalAlignment="Right" Margin="0,0,5,0" DockPanel.Dock="Right" Visibility="{Binding Path=IsDeletable, Converter={StaticResource BoolToVisibilityConverter}, Mode=Default}" Style="{DynamicResource RedButtonStyle}" />

                <TextBlock Text="{Binding Path=Name, Mode=Default, FallbackValue=Current Person}" Style="{DynamicResource HeaderStyle}" FontWeight="Bold" Height="23.94" Margin="5,1,10,0" DockPanel.Dock="Left" TextTrimming="CharacterEllipsis" Foreground="{DynamicResource HeaderFontColor}"/> 
            </DockPanel>
        </Border>

        <Border DockPanel.Dock="Top" Background="{DynamicResource PanelGradientBrush}" Style="{DynamicResource BorderStyle}" BorderThickness="1,0,1,1" CornerRadius="0,0,10,10">
            <DockPanel>
                <!-- Details Info displays the information about the person such as the person's photo, name, and birth date. -->
                <Border x:Name="DetailsInfo" DockPanel.Dock="Top" Style="{DynamicResource DetailsBorderStyle}" Margin="0,0,0,0" BorderThickness="0,0,0,0" CornerRadius="0,0,0,0" Padding="0,0,0,0" Height="315" Opacity="1" Background="{x:Null}">
                    <StackPanel Background="{x:Null}" Margin="0,0,0,0">
                        <Border BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
                            <Grid Margin="15,10,10,5">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="100" MinWidth="100" MaxWidth="100"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition MaxHeight="122" Height="122" />
                                    <RowDefinition Height="20"/>
                                </Grid.RowDefinitions>
                   
                                <Grid  Background="{x:Null}" Margin="0,0,0,0" AllowDrop="True" Drop="AvatarPhoto_Drop">
                                    
                                    <Border BorderBrush="#02747474" Background="#02000000" HorizontalAlignment="Left" Margin="0,5,5,5" VerticalAlignment="Top" BorderThickness="1,1,1,1">
                                        <Border.BitmapEffect>
                                            <DropShadowBitmapEffect ShadowDepth="7" Softness="0.75"/>
                                        </Border.BitmapEffect>
                                        <Image Source="{Binding Path=Avatar, Converter={StaticResource ImageConverter}, Mode=OneWay}" Stretch="Uniform"  VerticalAlignment="Top" MaxWidth="110" MaxHeight="122" StretchDirection="Both"/>
                                    </Border>
                                    
                                    <Border Visibility="{Binding Path=HasAvatar, Converter={StaticResource ComposingConverter}, Mode=Default}"  BorderBrush="#FFFFFFFF" Background="#02FFFFFF" Margin="0,5,5,5">
                                        <Grid>
                                            <Rectangle Fill="{DynamicResource NoPhotoBrush}" Stroke="{x:Null}" ToolTip="{x:Static properties:Resources.DropPhotosHere}">
                                                <Rectangle.BitmapEffect>
                                                        <DropShadowBitmapEffect ShadowDepth="7" Softness="0.75"/>
                                                </Rectangle.BitmapEffect>
                                            </Rectangle>
                                        </Grid>
                                    </Border>
                                    
                                </Grid>
                                
                                <Grid Grid.Row="1">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>    
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>

                                    <!--grayed out icons-->
                                    <Image Margin="-2,0,0,0" Opacity="0.4" HorizontalAlignment="Center"  VerticalAlignment="Center" Source="..\Images\Citation.png" Grid.Column="1" Width="16" Height="16" />
                                    <Image Margin="-2,0,0,0" Opacity="0.4" HorizontalAlignment="Center"  VerticalAlignment="Center" Source="..\Images\Photo.png" Grid.Column="2" Width="16" Height="16"  />
                                    <Image Margin="-2,0,0,0" Opacity="0.4" HorizontalAlignment="Center"  VerticalAlignment="Center" Source="..\Images\Note.png" Grid.Column="3" Width="16" Height="16" />
                                    <Image Margin="-2,0,0,0" Opacity="0.4" HorizontalAlignment="Center"  VerticalAlignment="Center"  Source="..\Images\Paperclip.png" Grid.Column="4" Width="16" Height="16" />
                                    <Image Margin="4,0,0,0" Opacity="0.4" HorizontalAlignment="Center"  VerticalAlignment="Center"  Source="..\Images\SecurityLock.png" Grid.Column="0" Width="16" Height="16" />

                                    <!--coloured icons if person has ... -->
                                    <Image Margin="-2,0,0,0" HorizontalAlignment="Center" Visibility="{Binding Path=HasCitations, Converter={StaticResource BoolToVisibilityConverter}, Mode=Default}" VerticalAlignment="Center" Source="..\Images\Citation.png" Grid.Column="1" Width="16" Height="16" ToolTip="{x:Static properties:Resources.HasCitations}" />
                                    <Image Margin="-2,0,0,0" HorizontalAlignment="Center" Visibility="{Binding Path=HasPhoto, Converter={StaticResource BoolToVisibilityConverter}, Mode=Default}" VerticalAlignment="Center" Source="..\Images\Photo.png" Grid.Column="2" Width="16" Height="16" ToolTip="{x:Static properties:Resources.HasPhotos}" />
                                    <Image Margin="-2,0,0,0" HorizontalAlignment="Center" Visibility="{Binding Path=HasNote, Converter={StaticResource BoolToVisibilityConverter}, Mode=Default}" VerticalAlignment="Center" Source="..\Images\Note.png" Grid.Column="3" Width="16" Height="16" ToolTip="{x:Static properties:Resources.HasNotes}" />
                                    <Image Margin="-2,0,0,0" HorizontalAlignment="Center" Visibility="{Binding Path=HasAttachments, Converter={StaticResource BoolToVisibilityConverter}, Mode=Default}" VerticalAlignment="Center"  Source="..\Images\Paperclip.png" Grid.Column="4" Width="16" Height="16" ToolTip="{x:Static properties:Resources.HasAttachments}" />
                                    <Image Margin="4,0,0,0" HorizontalAlignment="Center" Visibility="{Binding Path=HasRestriction, Converter={StaticResource BoolToVisibilityConverter}, Mode=Default}" VerticalAlignment="Center"  Source="..\Images\SecurityLock.png" Grid.Column="0" Width="16" Height="16" ToolTip="{x:Static properties:Resources.HasRestrictions}" />

                                </Grid>
                               
                                <StackPanel Margin="5,0,0,0" Grid.Column="1" Grid.RowSpan="2">
                                    <Label Content="{x:Static properties:Resources.NameAge}" Target="{Binding ElementName=NamesEditTextBox, Mode=OneWay}" Padding="5,5,5,0" DockPanel.Dock="Top" Margin="0,0,0,4"/>
                                    <TextBlock Text="{Binding Path=Name, Mode=OneWay, FallbackValue=Full name }" Foreground="{DynamicResource FontColor}" FontWeight="Bold" TextTrimming="CharacterEllipsis" HorizontalAlignment="Left" Margin="5,0,0,4" DockPanel.Dock="Top" FontSize="12" />
                                    <TextBlock Text="{Binding Path=Age, Mode=OneWay, FallbackValue=Age }" Foreground="{DynamicResource FontColor}" FontWeight="Bold" TextTrimming="CharacterEllipsis" HorizontalAlignment="Left" Margin="5,0,0,0" DockPanel.Dock="Top" FontSize="12" />
                                    <Label Content="{x:Static properties:Resources.Born}" Target="{Binding ElementName=BirthDateEditTextBox, Mode=OneWay}" Padding="5,8,5,0"  DockPanel.Dock="Top"  Margin="0,0,0,4"  />

                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="Auto"/>
                                        </Grid.ColumnDefinitions>
                                        <TextBlock Grid.Column="0" Text="{Binding Path=BirthDateDescriptor}" Foreground="{DynamicResource FontColor}" FontWeight="Bold" Margin="5,0,0,0" DockPanel.Dock="Top"  FontSize="12" />
                                        <TextBlock Grid.Column="1" Text="{Binding Path=BirthDate, Converter={StaticResource DateFormattingConverter}, Mode=OneWay, FallbackValue=Date of Birth}" Foreground="{DynamicResource FontColor}" FontWeight="Bold"  HorizontalAlignment="Left" Margin="0,0,0,5" DockPanel.Dock="Top" TextTrimming="CharacterEllipsis"  FontSize="12"  />
                                    </Grid>

                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="20*"/>
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>
                                        <TextBlock MaxWidth="114" Text="{Binding Path=BirthPlace, Mode=OneWay, FallbackValue=Place of Birth}" Foreground="{DynamicResource FontColor}" FontWeight="Bold"  HorizontalAlignment="Left" Margin="5,0,0,4" DockPanel.Dock="Top" TextTrimming="CharacterEllipsis"  FontSize="12"/>
                                        <Image Margin="2,0,0,0" x:Name="PlaceOfBirthSearch" HorizontalAlignment="Left" Visibility="{Binding Path=HasBirthPlace, Converter={StaticResource BoolToVisibilityConverter}, Mode=Default}" VerticalAlignment="Center"  Source="..\Images\Search.png" Grid.Column="3" Width="16" Height="16" ToolTip="{x:Static properties:Resources.MapToolTip}"  Cursor="Hand" MouseLeftButtonUp="SearchMapBirthPlace" />
                                    </Grid>
                                  
                                </StackPanel>
                            </Grid>
                        </Border>
                        
                        <TextBlock  Text="{x:Static properties:Resources.EditPerson}" Style="{DynamicResource SectionHeaderStyle}" Margin="15,5,0,5"/>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="50*"/>
                                <ColumnDefinition Width="50*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            
                            <Button Margin="15,0,5,0" x:Name="EditButton" Content="{x:Static properties:Resources.Details}" Grid.Column="0" Grid.Row="0" FontSize="10" Height="20" Width="115" HorizontalAlignment="Left" Style="{DynamicResource BlackButtonStyle}"/>
                            <Button Margin="15,2,5,2" x:Name="EditRelationshipsButton" Grid.Column="0" Grid.Row="1" Height="20" Content="{x:Static properties:Resources.Relationships}" HorizontalAlignment="Left" Width="115" Style="{DynamicResource BlackButtonStyle}" FontSize="10" />
                            <Button Margin="15,2,5,7" x:Name="InfoButton" Height="20" Grid.Column="0" Grid.Row="2" Content="{x:Static properties:Resources.PhotoStory}" HorizontalAlignment="Left" Width="115" Style="{DynamicResource BlackButtonStyle}" FontSize="10" Click="InfoButton_Click"/>
                            <Button Margin="7,2,10,2" x:Name="EditCitationsButton" Height="20" Grid.Column="1" Grid.Row="0" Content="{x:Static properties:Resources.Citations}" HorizontalAlignment="Left" Width="115" Style="{DynamicResource BlackButtonStyle}" FontSize="10"/>
                            <Button Margin="7,2,10,2" x:Name="EditAttachmentsButton" Height="20" Grid.Column="1" Grid.Row="1" Content="{x:Static properties:Resources.Attachments}" HorizontalAlignment="Left" Width="115" Style="{DynamicResource BlackButtonStyle}" FontSize="10"/>
                            <!--<Button Margin="7,2,10,7" Height="20" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left" Width="115" Style="{DynamicResource BlackButtonStyle}" FontSize="10"/>-->
                            
                        </Grid>

                        <Border BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,1,0,0" Height="52" Visibility="{Binding Path=IsLocked, Converter={StaticResource NotBoolToVisibilityConverter}, Mode=Default}">
                            <Grid Margin="10,0,10,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <TextBlock Text="{x:Static properties:Resources.CreateRelationship}" Style="{DynamicResource SectionHeaderStyle}" Margin="5,5,0,4"/>
                                <ComboBox IsSynchronizedWithCurrentItem="False" ItemsSource="{Binding Source={StaticResource RelationshipValuesEnumDS}}" x:Name="FamilyMemberComboBox" Height="20" Width="114" Grid.Row="1" HorizontalAlignment="Left" Margin="6,0,0,0" SelectionChanged="FamilyMemberComboBox_SelectionChanged" ItemTemplate="{DynamicResource FamilyMemberDataTemplate}" Style="{DynamicResource FamilyMemberComboBox}" IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}"/>
                                <Button x:Name="FamilyMemberAddButton" Content="{x:Static properties:Resources.AddFather}" Grid.Row="1" Click="FamilyMemberAddButton_Click" Margin="5,0,0,0" HorizontalAlignment="Left" Width="97" Height="20" FontSize="10" VerticalAlignment="Stretch" IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}"/>
 
                            </Grid>
                        </Border>
                        <Path Fill="#FFFFFFFF" Stretch="Fill" Stroke="#FF000000" Width="1" Height="1" Data="M64.5,146.06"/>
                    </StackPanel>
                </Border>

                <!-- Details Edit is used for modifying the person's details -->
                <Border x:Name="DetailsEdit" DockPanel.Dock="Top" Style="{DynamicResource DetailsBorderStyle}"  Margin="0,0,0,0" Background="{DynamicResource InputBackgroundBrush}" BorderThickness="0,1,0,1" CornerRadius="0,0,0,0" Padding="0,0,0,0" Height="555" Visibility="Visible">
                    <StackPanel Margin="10,5,10,0" HorizontalAlignment="Stretch">
                        <DockPanel Margin="0,0,0,5" DockPanel.Dock="Top">
                            <TextBlock Text="{x:Static properties:Resources.EditDetails}" TextWrapping="Wrap" Style="{DynamicResource SectionHeaderStyle}" Width="122" Height="15.96" Margin="5,0,0,0" HorizontalAlignment="Left" Foreground="{DynamicResource InputFontColor}"/>
                            <Button Margin="0,0,5,0" Content="{x:Static properties:Resources.More}" Height="15" FontSize="10" IsDefault="True"  x:Name="EditMoreButton" IsCancel="True" />
                            <Button HorizontalAlignment="Left" DockPanel.Dock="Top" Content="{x:Static properties:Resources.Done}" Height="15" FontSize="10" IsDefault="True" Width="Auto" MinWidth="60" x:Name="DoneEditButton" Click="DoneEditButton_Click" IsCancel="True" />
                        </DockPanel>

                        <StackPanel Orientation="Horizontal">
                            <StackPanel Margin="0,0,0,0" Width="250" >
                                <Grid>

                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto" />
                                    </Grid.RowDefinitions>
                                    

                                <Image Grid.Column="2" Grid.RowSpan="2" AllowDrop="True" Height="75" Width="80" Source="{Binding Path=Avatar, Converter={StaticResource ImageConverter}, Mode=OneWay}" />
                                    
                                <Label Grid.Row="0" Grid.Column="0" Content="{x:Static properties:Resources.Gender}" Padding="5,0,5,2" Foreground="{DynamicResource InputFontColor}"/>
                                <StackPanel Grid.Row="1" Grid.Column="0" Margin="5,0,0,0">
                                        <RadioButton IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}" GroupName="Gender1" Foreground="{DynamicResource InputFontColor}" Content="{x:Static properties:Resources.Male}" IsChecked="{Binding Path=Gender, Mode=TwoWay, Converter={StaticResource EnumToBoolConverter}, ConverterParameter=Male}"/>
                                        <RadioButton IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}" GroupName="Gender2" Foreground="{DynamicResource InputFontColor}" Content="{x:Static properties:Resources.Female}" IsChecked="{Binding Path=Gender,Mode=TwoWay, Converter={StaticResource EnumToBoolConverter}, ConverterParameter=Female}"/>
                                </StackPanel>
                                
       
                            <Label Grid.Row="0" Grid.Column="1" Content="{x:Static properties:Resources.Restriction}" Padding="5,0,5,2" Foreground="{DynamicResource InputFontColor}"/>
                                    <StackPanel Grid.Row="1" Grid.Column="1" Margin="5,0,0,0">
                                        <RadioButton  GroupName="Privacy1" Foreground="{DynamicResource InputFontColor}" Content="{x:Static properties:Resources.None}" IsChecked="{Binding Path=Restriction, Mode=TwoWay, Converter={StaticResource EnumToBoolConverter}, ConverterParameter=None}"/>
                                        <RadioButton  GroupName="Privacy2" Foreground="{DynamicResource InputFontColor}" Content="{x:Static properties:Resources.Locked}" IsChecked="{Binding Path=Restriction,Mode=TwoWay, Converter={StaticResource EnumToBoolConverter},ConverterParameter=Locked}"/>
                                        <RadioButton  GroupName="Privacy3" Foreground="{DynamicResource InputFontColor}" Content="{x:Static properties:Resources.Private}" IsChecked="{Binding Path=Restriction,Mode=TwoWay, Converter={StaticResource EnumToBoolConverter},ConverterParameter=Private}"/>
                                    </StackPanel>
                                </Grid>
                            </StackPanel>
                        </StackPanel>
                        <Label Content="{x:Static properties:Resources.Names}" Target="{Binding ElementName=NamesEditTextBox, Mode=OneWay}" Foreground="{DynamicResource InputFontColor}" />
                        <TextBox TextWrapping="NoWrap" x:Name="NamesEditTextBox" HorizontalAlignment="Left" Width="250" Margin="5,0,0,0" Text="{Binding Path=FirstName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}"/>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="145"/>
                                <ColumnDefinition Width="110"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" MinHeight="25" />
                                <RowDefinition Height="Auto" MinHeight="25" />
                            </Grid.RowDefinitions>
                            <Label Content="{x:Static properties:Resources.Surname}" Target="{Binding ElementName=SurnameEditTextBox, Mode=OneWay}" Margin="0,0,0,0" Foreground="{DynamicResource InputFontColor}" />
                            <TextBox TextWrapping="NoWrap" x:Name="SurnameEditTextBox" Grid.Row="1" Margin="0,0,0,0" Text="{Binding Path=LastName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Height="22" VerticalAlignment="Top" Width="135" IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}" />
                            <Label Content="{x:Static properties:Resources.Suffix}" Target="{Binding ElementName=SuffixEditTextBox, Mode=OneWay}" Grid.Column="1" Foreground="{DynamicResource InputFontColor}" Margin="0,0,0,0" />
                            <TextBox TextWrapping="NoWrap" x:Name="SuffixEditTextBox" Text="{Binding Path=Suffix, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Height="22" Margin="0,25,0,3" Width="110" Grid.Column="1" Grid.RowSpan="2" SnapsToDevicePixels="True" ClipToBounds="True" MinWidth="110" IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}"/>
                        </Grid>

						<Grid>
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="Auto"/>
								<ColumnDefinition Width="Auto"/>
							</Grid.ColumnDefinitions>
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="Auto"/>
							</Grid.RowDefinitions>

							<Label Grid.Column="0" x:Name="BirthDateLabel" MouseEnter="Label_MouseEnter" MouseLeave="Label_MouseLeave" Content="{x:Static properties:Resources.DateOfBirth}" MouseLeftButtonUp="ChangeBirthDescriptorForward" MouseRightButtonUp="ChangeBirthDescriptorBackward" Target="{Binding ElementName=BirthDateEditTextBox, Mode=OneWay}" Foreground="{DynamicResource InputFontColor}"  IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}"/>
							<Label Grid.Column="1" Margin="-6,0,0,0" Content="{Binding Path=BirthDateDescriptor}" Foreground="{DynamicResource InputFontColor}" />
							
						</Grid>

                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <TextBox TextWrapping="NoWrap" x:Name="BirthDateEditTextBox" Width="135" VerticalAlignment="Top" Grid.Row="1" Margin="5,0,0,0" Text="{Binding Path=BirthDate, Converter={StaticResource DateFormattingConverter}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" ToolTip="" ToolTipOpening="ToolTip_All" IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}"/>
                            <CheckBox Margin="10,0,0,0" VerticalAlignment="Center" Content="{x:Static properties:Resources.Living}"  Foreground="{DynamicResource InputFontColor}" Grid.Column="1" Grid.Row="1" IsChecked="{Binding Path=IsLiving, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, FallbackValue=True}" IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}"/>

                        </Grid>


                        <Label Content="{x:Static properties:Resources.BirthPlace}" Target="{Binding ElementName=BirthPlaceEditTextBox, Mode=OneWay}" Foreground="{DynamicResource InputFontColor}" />
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <TextBox TextWrapping="NoWrap" x:Name="BirthPlaceEditTextBox" Text="{Binding Path=BirthPlace, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="230" Grid.Column="0" HorizontalAlignment="Left" Margin="5,0,0,0" ToolTip="" ToolTipOpening="ToolTip_All" IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}" />
                            <Image Margin="4,0,0,0" Opacity="0.4" HorizontalAlignment="Center" VerticalAlignment="Center" Source="..\Images\Search.png" Grid.Column="1" Width="16" Height="16" />
                            <Image Margin="4,0,0,0" Cursor="Hand" x:Name="PlaceOfBirthSearch1" Visibility="{Binding Path=HasBirthPlace, Converter={StaticResource BoolToVisibilityConverter}, Mode=Default}" MouseLeftButtonUp="SearchMapBirthPlace" HorizontalAlignment="Center" VerticalAlignment="Center" Source="..\Images\Search.png" Grid.Column="1" Width="16" Height="16" ToolTip="{x:Static properties:Resources.MapToolTip}" />
                        </Grid>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Label MouseEnter="Label_MouseEnter" MouseLeave="Label_MouseLeave" Grid.Column="0" Content="{x:Static properties:Resources.DateOfDeath}" Target="{Binding ElementName=DeathDateEditTextBox, Mode=OneWay}" MouseLeftButtonUp="ChangeDeathDescriptorForward" MouseRightButtonUp="ChangeDeathDescriptorBackward" Foreground="{DynamicResource InputFontColor}" IsEnabled="{Binding Path=IsLockedIsLiving, Converter={StaticResource NotConverter}, Mode=Default}" />
                            <Label Grid.Column="1" Margin="-6,0,0,0" Content="{Binding Path=DeathDateDescriptor}" Foreground="{DynamicResource InputFontColor}" />
                        </Grid>
                        <TextBox TextWrapping="NoWrap" x:Name="DeathDateEditTextBox" Width="135" HorizontalAlignment="Left" Margin="5,0,0,0" IsEnabled="{Binding Path=IsLockedIsLiving, Converter={StaticResource NotConverter}, Mode=Default}" Text="{Binding Path=DeathDate, Converter={StaticResource DateFormattingConverter}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" ToolTip="" ToolTipOpening="ToolTip_All"/>
                        <Label Content="{x:Static properties:Resources.DeathPlace}"  Target="{Binding ElementName=DeathPlaceEditTextBox, Mode=OneWay}" Foreground="{DynamicResource InputFontColor}" />
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <TextBox TextWrapping="NoWrap" x:Name="DeathPlaceEditTextBox" Text="{Binding Path=DeathPlace, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="230" Margin="5,0,0,0" IsEnabled="{Binding Path=IsLockedIsLiving, Converter={StaticResource NotConverter}, Mode=Default}" Grid.Column="0" Height="21.96" ToolTip="" ToolTipOpening="ToolTip_All"/>
                            
                            <Image Margin="4,0,0,0" Opacity="0.4" HorizontalAlignment="Center" VerticalAlignment="Center" Source="..\Images\Search.png" Grid.Column="1" Width="16" Height="16" />
                            <Image Margin="4,0,0,0" Cursor="Hand" x:Name="PlaceOfDeathSearch" MouseLeftButtonUp="SearchMapDeathPlace" HorizontalAlignment="Center" Visibility="{Binding Path=HasDeathPlace, Converter={StaticResource BoolToVisibilityConverter}, Mode=Default}" VerticalAlignment="Center" Source="..\Images\Search.png" Grid.Column="1" Width="16" Height="16" ToolTip="{x:Static properties:Resources.MapToolTip}" />
                        </Grid>
                        <Label Content="{x:Static properties:Resources.Occupation}"  Target="{Binding ElementName=OccupationEditTextBox, Mode=OneWay}" Foreground="{DynamicResource InputFontColor}" />
                        <TextBox TextWrapping="NoWrap" AcceptsReturn="True" x:Name="OccupationEditTextBox" Width="250" Height="22" Text="{Binding Path=Occupation, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Margin="5,0,0,0" ToolTip="" ToolTipOpening="ToolTip_All" IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}"/>

                        <Label Content="{x:Static properties:Resources.Education}"  Target="{Binding ElementName=EducationEditTextBox, Mode=OneWay}" Foreground="{DynamicResource InputFontColor}" />
                        <TextBox TextWrapping="NoWrap" AcceptsReturn="True" x:Name="EducationEditTextBox" Width="250" Height="22" Text="{Binding Path=Education, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Margin="5,0,0,0" ToolTip="" ToolTipOpening="ToolTip_All" IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}"/>

                        <Label Content="{x:Static properties:Resources.Religion}"  Target="{Binding ElementName=ReligionEditTextBox, Mode=OneWay}" Foreground="{DynamicResource InputFontColor}" />
                        <TextBox TextWrapping="NoWrap" x:Name="ReligionEditTextBox" Width="250" Text="{Binding Path=Religion, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Margin="5,0,0,0" ToolTip="" ToolTipOpening="ToolTip_All" IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}"/>
                    </StackPanel>
                </Border>

                <!-- Details Edit More is used for modifying more of the person's details -->
                <Border x:Name="DetailsEditMore" DockPanel.Dock="Top" Style="{DynamicResource DetailsBorderStyle}"  Margin="0,0,0,0" Background="{DynamicResource InputBackgroundBrush}" BorderThickness="0,1,0,1" CornerRadius="0,0,0,0" Padding="0,0,0,0" Height="555" Visibility="Visible">

                    <StackPanel Margin="10,5,10,0" HorizontalAlignment="Stretch">
                        <DockPanel Margin="0,0,0,5" DockPanel.Dock="Top">
                            <TextBlock Text="{x:Static properties:Resources.EditMoreDetails}" TextWrapping="Wrap" Style="{DynamicResource SectionHeaderStyle}" Width="187" Height="15.96" Margin="5,0,0,0" HorizontalAlignment="Left" Foreground="{DynamicResource InputFontColor}"/>
                            <Button Margin="0,0,0,0" HorizontalAlignment="Left" DockPanel.Dock="Top" Content="{x:Static properties:Resources.Back}" Height="15" FontSize="10" IsDefault="True" Width="Auto" MinWidth="60" x:Name="DoneEditMoreButton" Click="DoneEditMoreButton_Click" IsCancel="True" />
                        </DockPanel>

                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>

                            <Label MouseEnter="Label_MouseEnter" MouseLeave="Label_MouseLeave" Grid.Row="0" Grid.Column="0" Content="{x:Static properties:Resources.BurialDate}"  Target="{Binding ElementName=BurialDateEditTextBox, Mode=OneWay}" MouseLeftButtonUp="ChangeBurialDescriptorForward" MouseRightButtonUp="ChangeBurialDescriptorBackward" Foreground="{DynamicResource InputFontColor}" IsEnabled="{Binding Path=IsLockedIsLiving, Converter={StaticResource NotConverter}, Mode=Default}" />
                            <Label Grid.Row="0" Grid.Column="1" Margin="-6,0,0,0" Content="{Binding Path=BurialDateDescriptor}" Foreground="{DynamicResource InputFontColor}" />

                            <TextBox Grid.Row="1" Grid.ColumnSpan="2" TextWrapping="NoWrap" x:Name="BurialDateEditTextBox" Width="135" HorizontalAlignment="Left" Margin="5,0,0,0" IsEnabled="{Binding Path=IsLockedIsLiving, Converter={StaticResource NotConverter}, Mode=Default}" Text="{Binding Path=BurialDate, Converter={StaticResource DateFormattingConverter}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" ToolTip="" ToolTipOpening="ToolTip_All"/>

                        </Grid>
                        <Label Content="{x:Static properties:Resources.BurialPlace}"  Target="{Binding ElementName=BurialPlaceEditTextBox, Mode=OneWay}" Foreground="{DynamicResource InputFontColor}" />
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <TextBox TextWrapping="NoWrap" x:Name="BurialPlaceEditTextBox" Text="{Binding Path=BurialPlace, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="230" Margin="5,0,0,0" IsEnabled="{Binding Path=IsLockedIsLiving, Converter={StaticResource NotConverter}, Mode=Default}" Grid.Column="0" Height="21.96" ToolTip="" ToolTipOpening="ToolTip_All"/>
                            <Image Margin="4,0,0,0" Opacity="0.4" HorizontalAlignment="Center" VerticalAlignment="Center" Source="..\Images\Search.png" Grid.Column="1" Width="16" Height="16" />
                            <Image Margin="4,0,0,0" Cursor="Hand" x:Name="PlaceOfBurialSearch" MouseLeftButtonUp="SearchMapBurialPlace" HorizontalAlignment="Center" Visibility="{Binding Path=HasBurialPlace, Converter={StaticResource BoolToVisibilityConverter}, Mode=Default}" VerticalAlignment="Center" Source="..\Images\Search.png" Grid.Column="1" Width="16" Height="16" ToolTip="{x:Static properties:Resources.MapToolTip}" />
                        </Grid>

                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Label MouseEnter="Label_MouseEnter" MouseLeave="Label_MouseLeave" Grid.Column="0" Content="{x:Static properties:Resources.CremationDate}"  Target="{Binding ElementName=CremationDateEditTextBox, Mode=OneWay}" MouseLeftButtonUp="ChangeCremationDescriptorForward" MouseRightButtonUp="ChangeCremationDescriptorBackward" Foreground="{DynamicResource InputFontColor}" IsEnabled="{Binding Path=IsLockedIsLiving, Converter={StaticResource NotConverter}, Mode=Default}" />
                            <Label Grid.Column="1" Margin="-6,0,0,0" Content="{Binding Path=CremationDateDescriptor}" Foreground="{DynamicResource InputFontColor}" />
                        </Grid>
                        <TextBox TextWrapping="NoWrap" x:Name="CremationDateEditTextBox" Width="135" HorizontalAlignment="Left" Margin="5,0,0,0" IsEnabled="{Binding Path=IsLockedIsLiving, Converter={StaticResource NotConverter}, Mode=Default}" Text="{Binding Path=CremationDate, Converter={StaticResource DateFormattingConverter}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" ToolTip="" ToolTipOpening="ToolTip_All"/>
                        <Label Content="{x:Static properties:Resources.CremationPlace}"  Target="{Binding ElementName=CremationPlaceEditTextBox, Mode=OneWay}" Foreground="{DynamicResource InputFontColor}" />
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <TextBox TextWrapping="NoWrap" x:Name="CremationPlaceEditTextBox" Text="{Binding Path=CremationPlace, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="230" Margin="5,0,0,0" IsEnabled="{Binding Path=IsLockedIsLiving, Converter={StaticResource NotConverter}, Mode=Default}" Grid.Column="0" Height="21.96" ToolTip="" ToolTipOpening="ToolTip_All"/>
                            <Image Margin="4,0,0,0" Opacity="0.4" HorizontalAlignment="Center" VerticalAlignment="Center" Source="..\Images\Search.png" Grid.Column="1" Width="16" Height="16" />
                            <Image Margin="4,0,0,0" Cursor="Hand" x:Name="PlaceOfCremationSearch" MouseLeftButtonUp="SearchMapCremationPlace" HorizontalAlignment="Center" Visibility="{Binding Path=HasCremationPlace, Converter={StaticResource BoolToVisibilityConverter}, Mode=Default}" VerticalAlignment="Center" Source="..\Images\Search.png" Grid.Column="1" Width="16" Height="16" ToolTip="{x:Static properties:Resources.MapToolTip}" />     
                        </Grid>

                    </StackPanel>
                </Border>

                
                
                <!-- Details Edit Citations is used for modifying the person's information sources -->

                <Border x:Name="DetailsEditCitations" DockPanel.Dock="Top" Style="{DynamicResource DetailsBorderStyle}"  Margin="0,0,0,0" Background="{DynamicResource InputBackgroundBrush}" BorderThickness="0,1,0,1" CornerRadius="0,0,0,0" Padding="0,0,0,0" Height="Auto" Width="Auto"  Visibility="Visible">

                    <StackPanel Margin="10,5,10,0">
                        <DockPanel Margin="0,0,0,5" DockPanel.Dock="Top">
                            <TextBlock Text="{x:Static properties:Resources.EditCitation}" TextWrapping="Wrap" Style="{DynamicResource SectionHeaderStyle}" Width="103" Height="15.96" Margin="5,0,0,0" HorizontalAlignment="Left" Foreground="{DynamicResource InputFontColor}"/>
                            <Button Margin="20,0,5,0" Content="{x:Static properties:Resources.Export}" Height="15" FontSize="10" IsDefault="True" Width="Auto" MinWidth="60" x:Name="ExportCitationsButton" Click="ExportCitations_Click" IsCancel="True" Style="{DynamicResource RedButtonStyle}" Visibility="{Binding Path=IsPrivate, Converter={StaticResource NotBoolToVisibilityConverter}, Mode=Default}"/>
                            <Button HorizontalAlignment="Right" DockPanel.Dock="Top" Content="{x:Static properties:Resources.Done}" Height="15" FontSize="10" IsDefault="True" Width="Auto" MinWidth="60" x:Name="DoneEditCitationsButton" Click="DoneEditCitationsButton_Click" IsCancel="True" />
                        </DockPanel>
                        
                        <ComboBox x:Name="CitationsComboBox" ItemTemplate="{DynamicResource CitationDataTemplate}" SelectedIndex="0"  ItemsSource="{Binding Source={StaticResource CitationValuesEnumDS}}" Width="250" Margin="5,0,0,0" SelectionChanged="CitationsComboBox_SelectionChanged"/>
                        
                        <Grid Margin="0,-8,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="175"/>
                                <ColumnDefinition Width="80"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" MinHeight="25" />
                                
                                
                                <RowDefinition Height="Auto" MinHeight="25" />
                                <RowDefinition Height="Auto" MinHeight="25" />
                                <RowDefinition Height="Auto" MinHeight="25" />
                                <RowDefinition Height="Auto" MinHeight="25" />
                                <RowDefinition Height="Auto" MinHeight="25" />
                                <RowDefinition Height="Auto" MinHeight="25" />
                                <RowDefinition Height="Auto" MinHeight="25" />

                            </Grid.RowDefinitions>
    
                            <Label Content="{x:Static properties:Resources.Details}" Margin="0,0,0,0" Foreground="{DynamicResource InputFontColor}" />
                            <TextBox TextWrapping="NoWrap" x:Name="CitationDetailsEditTextBox" LostFocus="CitationTextBox_LostFocus" Grid.Row="1" Margin="0,0,0,0" Height="22" VerticalAlignment="Top" Width="165" IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}"/>
                            <Label Content="{x:Static properties:Resources.Source}"  Grid.Column="1" Foreground="{DynamicResource InputFontColor}" Margin="0,0,0,0" />
                            <TextBox TextWrapping="NoWrap" x:Name="SourceEditTextBox" Height="22" LostFocus="CitationTextBox_LostFocus"  Margin="-15,25,-13,3" Width="80" Grid.Column="1" Grid.RowSpan="2" SnapsToDevicePixels="True" ClipToBounds="True" MinWidth="80" IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}"/>
                            
                            <Label Content="{x:Static properties:Resources.Note}" Grid.Row="2" Grid.Column="0" Foreground="{DynamicResource InputFontColor}" Margin="0,0,0,0" />
                            <TextBox TextWrapping="NoWrap" AcceptsReturn="True" ScrollViewer.VerticalScrollBarVisibility="Auto" Grid.Row="3" Grid.ColumnSpan="2" LostFocus="CitationTextBox_LostFocus"  x:Name="CitationNoteEditTextBox" Margin="0,0,-4,0" Height="66" VerticalAlignment="Top" Width="250" IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}"/>

                            <Label Content="{x:Static properties:Resources.ActualText}"   Grid.Row="4" Grid.Column="0" Foreground="{DynamicResource InputFontColor}" Margin="0,0,0,0" />
                            <TextBox TextWrapping="NoWrap" AcceptsReturn="True" ScrollViewer.VerticalScrollBarVisibility="Auto" x:Name="CitationActualTextEditTextBox" LostFocus="CitationTextBox_LostFocus"  Grid.ColumnSpan="2" Grid.Row="5" Margin="0,0,-4,0" Height="66" VerticalAlignment="Top" Width="250" IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}"/>

                            <Label Content="{x:Static properties:Resources.Link}"  Grid.Row="6"  Foreground="{DynamicResource InputFontColor}" Margin="0,0,0,0" />
                            <TextBox TextWrapping="NoWrap" x:Name="CitationLinkEditTextBox" LostFocus="CitationTextBox_LostFocus" Height="22" Margin="5,0,-60,3" Width="130" Grid.Column="0" Grid.Row="7"  Grid.ColumnSpan="1"  SnapsToDevicePixels="True" ClipToBounds="True" MinWidth="230" IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}"/>
                            
                            <Image Margin="0,0,0,2" Grid.Row="7" Cursor="Hand" x:Name="CitationLinkSearch" MouseLeftButtonUp="CitationLinkSearchClick" HorizontalAlignment="Right" VerticalAlignment="Center" Source="..\Images\Search.png" Grid.Column="1" Width="16" Height="16" ToolTip="Load this citation in the default browser." />

                        </Grid>

                    </StackPanel>
                </Border>

                <!-- Details Edit Attachments is used for modifying the person's attachments -->

                <Border x:Name="DetailsEditAttachments"  AllowDrop="True" DockPanel.Dock="Top" Style="{DynamicResource DetailsBorderStyle}"  Margin="0,0,0,0" Background="{DynamicResource InputBackgroundBrush}" BorderThickness="0,1,0,1" CornerRadius="0,0,0,0" Padding="0,0,0,0" Height="400" Width="auto"  Visibility="Visible">

                    <StackPanel Margin="10,5,10,0">
                        <DockPanel Margin="0,0,0,5" DockPanel.Dock="Top">
                            <TextBlock Text="{x:Static properties:Resources.EditAttachments}" TextWrapping="Wrap" Style="{DynamicResource SectionHeaderStyle}" Width="103" Height="15.96" Margin="5,0,0,0" HorizontalAlignment="Left" Foreground="{DynamicResource InputFontColor}"/>
                            
                            <Button Margin="0,0,3,0" HorizontalAlignment="Right" DockPanel.Dock="Top" Content="{x:Static properties:Resources.Done}" Height="15" FontSize="10" IsDefault="True" Width="Auto" MinWidth="60" x:Name="DoneEditAttachmentsButton" IsCancel="True" />
                        </DockPanel>

                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="175"/>
                                <ColumnDefinition Width="80"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" MinHeight="25" />
                                <RowDefinition Height="Auto" MinHeight="25" />
                            </Grid.RowDefinitions>
                            <Label Content="{x:Static properties:Resources.Attachments}" Margin="0,0,0,0" Foreground="{DynamicResource InputFontColor}" />
                            <ListBox KeyDown="AttachmentsListBox_KeyDown" Drop="AttachmentsListBox_Drop" Grid.Row="1" Grid.ColumnSpan="2" MinHeight="320" Height="320" IsSynchronizedWithCurrentItem="True" ItemTemplate="{DynamicResource AttachmentSetTemplate}" ItemsSource="{Binding Path=Attachments, Mode=OneWay}" ScrollViewer.VerticalScrollBarVisibility="Auto" x:Name="AttachmentsListBox"  MouseDoubleClick="LoadSelectedAttachment" Margin="5,0,5,0" />
                                                      

                           
                        </Grid>
                        
                        <Grid Margin="5,5,5,0" >

                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                        <Button Grid.Column="1" Content="{x:Static properties:Resources.Add}" Height="15" FontSize="10" IsDefault="True" Width="Auto" MinWidth="60" x:Name="AddAttachment" Click="AddAttachmentsButton_Click" IsCancel="True" Style="{DynamicResource RedButtonStyle}" Visibility="{Binding Path=IsLocked, Converter={StaticResource NotBoolToVisibilityConverter}, Mode=Default}"/>
                        <Button Grid.Column="2" Content="{x:Static properties:Resources.Delete}" Height="15" FontSize="10" IsDefault="True" Width="Auto" MinWidth="60" x:Name="DeleteAttachment" Click="DeleteAttachmentsButton_Click" IsCancel="True" Style="{DynamicResource RedButtonStyle}" Visibility="{Binding Path=IsLocked, Converter={StaticResource NotBoolToVisibilityConverter}, Mode=Default}"/>
                        <Button  Grid.Column="0"  Content="{x:Static properties:Resources.Open}" Height="15" FontSize="10" IsDefault="True" Width="Auto" MinWidth="60" x:Name="OpenAttachment" Click="LoadSelectedAttachment" IsCancel="True" Style="{DynamicResource RedButtonStyle}"/>
                        <Button Grid.Column="3"  Content="{x:Static properties:Resources.Link}" Height="15" FontSize="10" IsDefault="True" Width="Auto" MinWidth="60" x:Name="LinkAttachment" Click="LinkAttachmentsButton_Click" IsCancel="True" Style="{DynamicResource RedButtonStyle}" Visibility="{Binding Path=IsLocked, Converter={StaticResource NotBoolToVisibilityConverter}, Mode=Default}"/>

                        </Grid>

                    </StackPanel>
                </Border>

                <!-- Details Edit Relationsip is used for modifying the person's relationship with the parents, spouse(s) and siblings -->
                <Border x:Name="DetailsEditRelationship" DockPanel.Dock="Top" Style="{DynamicResource DetailsBorderStyle}"  Margin="0,0,0,0" Background="{DynamicResource InputBackgroundBrush}" BorderThickness="0,1,0,1" CornerRadius="0,0,0,0" Padding="0,0,0,0" Height="Auto" Visibility="Visible">
                    <DockPanel Margin="10,5,10,0" HorizontalAlignment="Stretch" Height="Auto">

                        <DockPanel Margin="0,0,0,5" DockPanel.Dock="Top">
                            <TextBlock Text="{x:Static properties:Resources.EditRelationships}" TextWrapping="Wrap" Style="{DynamicResource SectionHeaderStyle}" Width="140" Height="15.96" Margin="5,0,0,0" HorizontalAlignment="Left" Foreground="{DynamicResource InputFontColor}"/>
                            <Button HorizontalAlignment="Right" Margin="0,0,3,0" DockPanel.Dock="Top" Content="{x:Static properties:Resources.Done}" Height="15" FontSize="10" IsDefault="True" Width="Auto" MinWidth="60" x:Name="DoneEditRelationshipButton" Click="DoneEditRelationshipButton_Click" IsCancel="True" />
                        </DockPanel>

                        <DockPanel Margin="0,0,0,5" DockPanel.Dock="Top">
                            <TextBlock Text="{x:Static properties:Resources.Siblings}" TextWrapping="Wrap" Style="{DynamicResource SectionHeaderStyle}" Width="140" Height="15.96" Margin="5,0,0,0" HorizontalAlignment="Left" Foreground="{DynamicResource InputFontColor}"/>
                        </DockPanel>

                        <TextBlock DockPanel.Dock="Top" Text="{x:Static properties:Resources.None}" Margin="10,0,0,0" Foreground="{DynamicResource InputFontColor}" Visibility="{Binding Path=HasSiblings, Converter={StaticResource ComposingConverter}, Mode=Default }"/>

                        <StackPanel DockPanel.Dock="Top" Margin="0,0,0,0" Visibility="{Binding Path=HasSiblings, Converter={StaticResource BoolToVisibilityConverter}, Mode=Default}">
                            <DockPanel Margin="0,0,0,0" DockPanel.Dock="Top">
                                <ComboBox x:Name="SiblingsCombobox" IsSynchronizedWithCurrentItem="True" ItemTemplate="{DynamicResource ParentSetTemplate}" ItemsSource="{Binding Path=Siblings, Mode=OneWay}" HorizontalAlignment="Left" Margin="10,0,0,0" Width="150" />
                                <Button Margin="0,0,3,0" HorizontalAlignment="Right" DockPanel.Dock="Top" Content="{x:Static properties:Resources.RemoveSibling}" Height="15" FontSize="10" Width="80" x:Name="RemoveSiblingButton" Click="RemoveSiblingsButton_Click" IsCancel="True"  Visibility="{Binding Path=IsLocked, Converter={StaticResource NotBoolToVisibilityConverter}, Mode=Default}" Style="{DynamicResource RedButtonStyle}" IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}"/>
                            </DockPanel>
                        </StackPanel>

                        <DockPanel Margin="0,5,0,5" DockPanel.Dock="Top">
                            <TextBlock Text="{x:Static properties:Resources.Parents}" TextWrapping="Wrap" Style="{DynamicResource SectionHeaderStyle}" Width="140" Height="15.96" Margin="5,0,0,0" HorizontalAlignment="Left" Foreground="{DynamicResource InputFontColor}"/>
                        </DockPanel>

                        <TextBlock DockPanel.Dock="Top" Text="{x:Static properties:Resources.None}" Margin="10,0,0,0" Foreground="{DynamicResource InputFontColor}" Visibility="{Binding Path=HasParents, Converter={StaticResource ComposingConverter}, Mode=Default }"/>

                        <StackPanel DockPanel.Dock="Top" Visibility="{Binding Path=HasParents, Converter={StaticResource BoolToVisibilityConverter}, Mode=Default}" >
                            <DockPanel Margin="0,0,0,5" DockPanel.Dock="Top">
                                <ComboBox x:Name="ParentsCombobox" IsSynchronizedWithCurrentItem="True" ItemTemplate="{DynamicResource ParentSetTemplate}" ItemsSource="{Binding Path=Parents, Mode=OneWay}" SelectionChanged="ParentsCombobox_SelectionChanged" HorizontalAlignment="Left" Margin="10,0,0,0" Width="150" />
                                <Button Margin="0,0,3,0" HorizontalAlignment="Right" DockPanel.Dock="Top" Content="{x:Static properties:Resources.RemoveParent}" Height="15" FontSize="10"  Width="80" x:Name="RemoveParentButton" Click="RemoveParentButton_Click" IsCancel="True"  Visibility="{Binding Path=IsLocked, Converter={StaticResource NotBoolToVisibilityConverter}, Mode=Default}" Style="{DynamicResource RedButtonStyle}" IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}"/>
                            </DockPanel>
                            
                            <RadioButton Margin="14,0,0,0" x:Name="ParentModifer" Visibility="{Binding Path=IsLocked, Converter={StaticResource BoolToVisibilityConverter}, Mode=Default}" Foreground="{DynamicResource InputFontColor}" IsChecked="True"/>
                      
                            <ListBox x:Name="ParentChildListbox" ItemTemplate="{DynamicResource ParentChildModifierDataTemplate}" KeyboardNavigation.DirectionalNavigation="Cycle" BorderBrush="Transparent" Foreground="{DynamicResource InputFontColor}" Background="{x:Null}" Padding="10,10,0,0" SelectionChanged="ParentChildListbox_SelectionChanged" Margin="0,-15,0,0" Visibility="{Binding Path=IsLocked, Converter={StaticResource NotBoolToVisibilityConverter}, Mode=Default}">
                                <ListBox.Resources>
                                    <Style x:Key="{x:Type ListBoxItem}" TargetType="{x:Type ListBoxItem}" >
                                            <Setter Property="Margin" Value="2, 2, 2, 0" />
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate>
                                                        <Border Background="Transparent">
                                                            <RadioButton IsHitTestVisible="False" Focusable="False" Foreground="{Binding Path=Foreground, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
                              Content="{Binding Converter={StaticResource EnumValueDescriptionConverter}}"
                              IsChecked="{Binding Path=IsSelected, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
                                                        </Border>
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Style>
                                </ListBox.Resources>
                                <ListBox.ItemsSource>
                                    <Binding Mode="OneWay" Source="{StaticResource ParentChildEnumDS}" />
                                </ListBox.ItemsSource>
                            </ListBox>

                        </StackPanel>

                        <StackPanel>
                            <DockPanel Margin="0,5,0,5" DockPanel.Dock="Top">
                                <TextBlock DockPanel.Dock="Top" Text="{x:Static properties:Resources.SpousePartner}" TextWrapping="Wrap" Style="{DynamicResource SectionHeaderStyle}" Width="198.067" Height="18" Margin="5,0,0,0" HorizontalAlignment="Left" Foreground="{DynamicResource InputFontColor}" />
                            </DockPanel>
                            <TextBlock DockPanel.Dock="Top" Text="{x:Static properties:Resources.None}" Margin="10,0,0,0" Foreground="{DynamicResource InputFontColor}" Visibility="{Binding Path=HasSpouse, Converter={StaticResource ComposingConverter}, Mode=Default}"/>
                         
                            <StackPanel DockPanel.Dock="Top" Margin="0,0,0,0" Visibility="{Binding Path=HasSpouse, Converter={StaticResource BoolToVisibilityConverter}, Mode=Default}" >
                                <DockPanel Margin="0,0,0,0" DockPanel.Dock="Top">
                                    <ComboBox x:Name="SpousesCombobox" IsSynchronizedWithCurrentItem="True" ItemTemplate="{DynamicResource ParentSetTemplate}" ItemsSource="{Binding Path=Spouses, Mode=OneWay}" SelectionChanged="SpousesCombobox_SelectionChanged" HorizontalAlignment="Left" Margin="10,0,0,0" Width="150"/>
                                    <Button Margin="0,4,3,0"  HorizontalAlignment="Right" DockPanel.Dock="Top" Content="{x:Static properties:Resources.RemoveSpouse}" Height="15" FontSize="10" Width="80" x:Name="RemoveSpouseButton" Click="RemoveSpouseButton_Click" IsCancel="True" Visibility="{Binding Path=IsLocked, Converter={StaticResource NotBoolToVisibilityConverter}, Mode=Default}" Style="{DynamicResource RedButtonStyle}" />
                                </DockPanel>
                               
                                <RadioButton Margin="14,3,0,0" x:Name="SpouseModifer" Visibility="{Binding Path=IsLocked, Converter={StaticResource BoolToVisibilityConverter}, Mode=Default}" Foreground="{DynamicResource InputFontColor}" IsChecked="True"/>
                                
                                <ListBox x:Name="SpouseStatusListbox" ItemTemplate="{DynamicResource SpouseModifierDataTemplate}" KeyboardNavigation.DirectionalNavigation="Cycle" BorderBrush="Transparent" Foreground="{DynamicResource InputFontColor}" Background="{x:Null}" Padding="10,10,0,0" SelectionChanged="SpouseStatusListbox_SelectionChanged" Margin="0,-10,0,0" Visibility="{Binding Path=IsLocked, Converter={StaticResource NotBoolToVisibilityConverter}, Mode=Default}">
                                    <ListBox.Resources>
                                        <Style x:Key="{x:Type ListBoxItem}" TargetType="{x:Type ListBoxItem}" >
                                            <Setter Property="Margin" Value="2, 2, 2, 0" />
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate>
                                                        <Border Background="Transparent">
                                                            <RadioButton IsHitTestVisible="False" Focusable="False" Foreground="{Binding Path=Foreground, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
                              Content="{Binding Converter={StaticResource EnumValueDescriptionConverter}}"                    
                              IsChecked="{Binding Path=IsSelected, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
                                                        </Border>
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Style>
                                    </ListBox.Resources>
                                    <ListBox.ItemsSource>
                                        <Binding Mode="OneWay" Source="{StaticResource SpouseStatusEnumDS}"/>
                                    </ListBox.ItemsSource>
                                </ListBox>
                                
                                <Grid HorizontalAlignment="Left" Margin="10,0,0,0" Width="237.754">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="40*" />
                                        <ColumnDefinition Width="155*" />
                                        <ColumnDefinition Width="25" />
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="24"/>
                                        <RowDefinition Height="24"/>
                                        <RowDefinition Height="24"/>
                                       
                                    </Grid.RowDefinitions>


                                    <Label MouseEnter="Label_MouseEnter" MouseLeave="Label_MouseLeave" Content="{x:Static properties:Resources.From}" Height="22" Margin="-5,-10,0,0" MouseLeftButtonUp="ChangeMarriageDescriptorForward" MouseRightButtonUp="ChangeMarriageDescriptorBackward" HorizontalAlignment="Left" Target="{Binding ElementName=FromEditTextBox, Mode=OneWay}" Foreground="{DynamicResource InputFontColor}" IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}"/>
                                    <Label x:Name="FromDescriptor" Grid.Column="1" Height="22" Margin="-5,-10,0,0" Foreground="{DynamicResource InputFontColor}" />
                                    <TextBox Grid.Column="2" TextWrapping="Wrap" x:Name="FromEditTextBox" Width="140" LostFocus="FromEditTextBox_LostFocus" Height="22" Margin="0,0,0,0" IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}"/>

                                    <Label MouseEnter="Label_MouseEnter" MouseLeave="Label_MouseLeave" x:Name="ToLabel" Grid.Row="1" Content="{x:Static properties:Resources.To}" Margin="-5,-10,0,0" MouseLeftButtonUp="ChangeDivorceDescriptorForward" MouseRightButtonUp="ChangeDivorceDescriptorBackward" Height="22" HorizontalAlignment="Left" Target="{Binding ElementName=ToEditTextBox, Mode=OneWay}" Foreground="{DynamicResource InputFontColor}" IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}"/>
                                    <Label x:Name="ToDescriptor" Grid.Row="1" Grid.Column="1" Height="22" Margin="0,-10,0,0" Foreground="{DynamicResource InputFontColor}" />
                                    <TextBox Grid.Row="1" Grid.Column="2" TextWrapping="Wrap" x:Name="ToEditTextBox" Width="140" LostFocus="ToEditTextBox_LostFocus" Height="22" Margin="0,0,0,0" IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}"/>

                                

                                    <Label Grid.Row="2" Margin="-5,-7,0,0" Content="{x:Static properties:Resources.Place}" Height="25" HorizontalAlignment="Left" Target="{Binding ElementName=ToEditTextBox, Mode=OneWay}" Foreground="{DynamicResource InputFontColor}" />
                                    <TextBox Grid.Row="2" Grid.Column="1" TextWrapping="NoWrap" x:Name="PlaceEditTextBox" Width="173" LostFocus="PlaceEditTextBox_LostFocus" IsEnabled="{Binding Path=IsLocked, Converter={StaticResource NotConverter}, Mode=Default}" Grid.ColumnSpan="3" Height="22" Margin="2,0,23,0" />
                                    <Image Margin="4,0,0,0" Grid.Row="2" Opacity="0.4" HorizontalAlignment="Center" VerticalAlignment="Center" Source="..\Images\Search.png" Grid.Column="3" Width="16" Height="16" />
                                    <Image Margin="4,0,0,0" Cursor="Hand" MouseLeftButtonUp="SearchMapMarriagePlace" HorizontalAlignment="Center" VerticalAlignment="Center" Source="..\Images\Search.png" Grid.Column="3" Grid.Row="2" Width="16" Height="16" ToolTip="{x:Static properties:Resources.MapToolTip}" />
                                </Grid>

                                <TextBlock Text="{x:Static properties:Resources.SpousePartnerCitation}" TextWrapping="Wrap" Style="{DynamicResource SectionHeaderStyle}" Width="140" Height="15.96" Margin="5,3,0,0" HorizontalAlignment="Left" Foreground="{DynamicResource InputFontColor}"/>
                                <Grid Margin="1,4,0,0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="175"/>
                                        <ColumnDefinition Width="80"/>
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" MinHeight="20" />
                                        <RowDefinition Height="Auto" MinHeight="25" />
                                        <RowDefinition Height="Auto" MinHeight="25" />
                                        <RowDefinition Height="Auto" MinHeight="25" />
                                        <RowDefinition Height="Auto" MinHeight="25" />
                                        <RowDefinition Height="Auto" MinHeight="25" />
                                        <RowDefinition Height="Auto" MinHeight="25" />
                                        <RowDefinition Height="Auto" MinHeight="25" />
                                        <RowDefinition Height="Auto" MinHeight="25" />
                                        <RowDefinition Height="Auto" MinHeight="25" />
                                        <RowDefinition Height="Auto" MinHeight="20" />
                                        <RowDefinition Height="Auto" MinHeight="20" />
                                    </Grid.RowDefinitions>

                                    <ComboBox x:Name="RelationshipsCitationsComboBox"  ItemTemplate="{DynamicResource RelationshipCitationDataTemplate}" SelectedIndex="0" Grid.Row="0" Grid.ColumnSpan="2" ItemsSource="{Binding Source={StaticResource RCitationValuesEnumDS}}" Width="240" Margin="5,0,0,0" SelectionChanged="RelationshipsCitationsComboBox_SelectionChanged"/>


                                    <Label Content="{x:Static properties:Resources.Details}" Margin="5,-6,0,0" Grid.Row="1" Foreground="{DynamicResource InputFontColor}" />
                                    <TextBox TextWrapping="NoWrap" x:Name="RCitationDetailsEditTextBox" LostFocus="RCitationDetailsEditTextBox_LostFocus" Grid.Row="2" Margin="5,-6,0,0" Height="22" VerticalAlignment="Top" Width="160" />
                                    <Label Content="{x:Static properties:Resources.Source}"  Grid.Row="1" Grid.Column="1" Foreground="{DynamicResource InputFontColor}" Margin="0,-6,0,0" />
                                    <TextBox TextWrapping="NoWrap" x:Name="RSourceEditTextBox" Height="22" LostFocus="RSourceEditTextBox_LostFocus"  Margin="-15,13,-10,3" Width="75" Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" SnapsToDevicePixels="True" ClipToBounds="True" MinWidth="75" />

                                    <Label Content="{x:Static properties:Resources.Note}" Grid.Row="3" Grid.Column="0" Foreground="{DynamicResource InputFontColor}" Margin="5,-15,0,0" />
                                    <TextBox TextWrapping="NoWrap" AcceptsReturn="True" Grid.Row="4" Grid.ColumnSpan="2" LostFocus="RCitationNoteEditTextBox_LostFocus"  x:Name="RCitationNoteEditTextBox" Margin="0,-15,-5,0" Height="22" VerticalAlignment="Top" Width="240" />

                                    <Label Content="{x:Static properties:Resources.ActualText}"  Grid.Row="5" Grid.Column="0" Foreground="{DynamicResource InputFontColor}" Margin="5,-22,0,0" />
                                    <TextBox TextWrapping="NoWrap" AcceptsReturn="True" x:Name="RCitationActualTextEditTextBox" LostFocus="RCitationActualTextEditTextBox_LostFocus"  Grid.ColumnSpan="2" Grid.Row="5" Margin="11,5,4,23" Height="22" Width="240" Grid.RowSpan="2" />

                                    <Label Content="{x:Static properties:Resources.Link}"  Grid.Row="7"  Foreground="{DynamicResource InputFontColor}" Margin="5,-27,0,0" />
                                    <TextBox TextWrapping="NoWrap" x:Name="RCitationLinkEditTextBox" LostFocus="RCitationLinkEditTextBox_LostFocus" Height="22" Margin="0,-55,-59,3" Width="80" Grid.Column="0" Grid.Row="8"   SnapsToDevicePixels="True" ClipToBounds="True" MinWidth="214" />
                                    
                                    <Image Margin="4,-8,10,0" Grid.Row="7" Cursor="Hand" x:Name="RCitationSearch" MouseLeftButtonUp="RCitationLinkSearchClick" HorizontalAlignment="Right" VerticalAlignment="Center" Source="..\Images\Search.png" Grid.Column="1" Width="16" Height="16" ToolTip="Load this citation in your default browser." />

                                </Grid>
          
                            </StackPanel>

                        </StackPanel>

                    </DockPanel>


                </Border>

                <!-- Details Add is used to add new people -->
                <Border x:Name="DetailsAdd" DockPanel.Dock="Top" Style="{DynamicResource DetailsBorderStyle}" Margin="0,0,0,0" BorderThickness="0,1,0,0" CornerRadius="0,0,0,0" Padding="0,0,0,0" Height="300" Background="{DynamicResource InputBackgroundBrush}" Visibility="Visible" >
                    <StackPanel>
                        <TextBlock Text="{x:Static properties:Resources.AddAFamilyMember}" Margin="15,5,5,5" TextWrapping="Wrap" Style="{DynamicResource SectionHeaderStyle}" Foreground="{DynamicResource InputFontColor}"></TextBlock>
                        <StackPanel Orientation="Horizontal" Margin="15,0,10,0" HorizontalAlignment="Left" >
                            <TextBlock TextTrimming="CharacterEllipsis" MaxWidth="180" MaxHeight="30"  LineStackingStrategy="MaxHeight" Text="{Binding Path=FirstName, Converter={StaticResource FirstNamePossessiveFormConverter}, Mode=Default, FallbackValue=Name}" TextWrapping="Wrap" Style="{DynamicResource HeaderStyle}" HorizontalAlignment="Left" FontSize="18" FontWeight="Bold" Margin="0,0,0,0" Foreground="{DynamicResource InputFontColor}"/>
                            <TextBlock x:Name="Relationship" TextWrapping="Wrap" Style="{DynamicResource HeaderStyle}" HorizontalAlignment="Left" FontSize="18" FontWeight="Bold" Margin="0,0,0,0"/>
                        </StackPanel>
                        <Border Margin="10,5,10,0" BorderThickness="0,2,0,0">
                            <StackPanel Margin="0,0,0,0">
                                <Label Content="{x:Static properties:Resources.Names}" Target="{Binding ElementName=NamesInputTextBox, Mode=OneWay}" Foreground="{DynamicResource InputFontColor}"/>
                                <TextBox TextWrapping="Wrap" x:Name="NamesInputTextBox" HorizontalAlignment="Left" Width="250" Margin="5,0,0,0"/>

                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="145"/>
                                        <ColumnDefinition Width="110"/>

                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" MinHeight="25" />
                                        <RowDefinition Height="Auto" MinHeight="25" />
                                    </Grid.RowDefinitions>
                                    <Label Content="{x:Static properties:Resources.Surname}" Target="{Binding ElementName=SurnameInputTextBox, Mode=OneWay}" Margin="0,0,0,0" Foreground="{DynamicResource InputFontColor}" />
                                    <TextBox TextWrapping="Wrap" x:Name="SurnameInputTextBox" Grid.Row="1" Margin="0,0,0,0" Height="22" VerticalAlignment="Top" Width="135" />
                                    <Label Content="{x:Static properties:Resources.Suffix}" Target="{Binding ElementName=SuffixInputTextBox, Mode=OneWay}" Grid.Column="1" Foreground="{DynamicResource InputFontColor}" Margin="0,0,0,0" />
                                    <TextBox TextWrapping="Wrap" x:Name="SuffixInputTextBox" Height="22" HorizontalAlignment="Right" Margin="0,24.989,0,3.011" Width="110" Grid.ColumnSpan="2" Grid.Column="1" Grid.RowSpan="2" SnapsToDevicePixels="True" ClipToBounds="True" MinWidth="110" />
                                </Grid>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Label Content="{x:Static properties:Resources.DateOfBirth}" Target="{Binding ElementName=BirthDateInputTextBox, Mode=OneWay}" Foreground="{DynamicResource InputFontColor}" />
                                    <TextBox TextWrapping="Wrap" x:Name="BirthDateInputTextBox" Width="135" VerticalAlignment="Top" Grid.Row="1" Margin="5,0,0,0" Text="{Binding Path=BirthDate, Converter={StaticResource DateFormattingConverter}, Source={StaticResource person}, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"/>
                                    <CheckBox Margin="10,0,0,0" VerticalAlignment="Center" Content="{x:Static properties:Resources.Living}" Foreground="{DynamicResource InputFontColor}" Grid.Column="1" Grid.Row="1" x:Name="IsLivingInputCheckbox" IsChecked="True"/>
                                </Grid>
                                <Label Content="{x:Static properties:Resources.BirthPlace}" Target="{Binding ElementName=BirthPlaceInputTextBox, Mode=OneWay}" Foreground="{DynamicResource InputFontColor}" />
                                <Grid>

                                    <TextBox TextWrapping="Wrap" x:Name="BirthPlaceInputTextBox" Width="250" HorizontalAlignment="Left" Grid.Column="0" Margin="5,0,0,0"/>

                                </Grid>

                                <Border Margin="0,10,0,0" BorderBrush="#FF6573A0" BorderThickness="0,2,0,0" Height="42">
                                    <StackPanel Margin="5,10,0,10" Orientation="Horizontal">
                                        <Button Content="{x:Static properties:Resources.Add}" x:Name="AddButton" Height="15" FontSize="10" IsDefault="True" HorizontalAlignment="Left" Width="Auto" MinWidth="60" Click="AddButton_Click" Style="{DynamicResource RedButtonStyle}"/>
                                        <Button x:Name="CloseButton" Content="{x:Static properties:Resources.Cancel}" Height="15" IsCancel="True" FontSize="10" Width="Auto" MinWidth="60" Margin="5,0,0,0" Click="CloseButton_Click" />
                                    </StackPanel>
                                </Border>
                            </StackPanel>
                        </Border>
                    </StackPanel>
                </Border>

                <!-- AddExisting is used to a relationship to an existing person in the tree-->
                <Border x:Name="AddExisting" DockPanel.Dock="Top" Style="{DynamicResource DetailsBorderStyle}" Margin="0,0,0,0" BorderThickness="0,1,0,1" CornerRadius="0,0,0,0" Padding="0,0,0,0" Height="555" Background="{DynamicResource InputBackgroundBrush}" Visibility="Visible">

                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>

                        <DockPanel Grid.Row="2">
                            <DockPanel Margin="15,0,15,0" DockPanel.Dock="Top">
                                <TextBlock Text="{x:Static properties:Resources.FilterColon}" Foreground="{DynamicResource InputFontColor}" VerticalAlignment="Center"/>
                                <TextBlock Text=" (" TextWrapping="Wrap" Foreground="{DynamicResource InputFontColor}" VerticalAlignment="Center"/>
                                <TextBlock Text="{Binding Path=Items.Count, ElementName=ExistingPeopleListBox, Mode=Default}" TextWrapping="Wrap" Foreground="{DynamicResource InputFontColor}" VerticalAlignment="Center"/>
                                <TextBlock Text=") " TextWrapping="Wrap" Foreground="{DynamicResource InputFontColor}" VerticalAlignment="Center"/>
                                <local:FilterText x:Name="ExistingFilterTextBox" TextBoxBase.TextChanged="ExistingFilterTextBox_TextChanged"/>
                            </DockPanel>
                            <ListBox IsSynchronizedWithCurrentItem="True" Margin="15,5,15,0" x:Name="ExistingPeopleListBox" ItemTemplate="{DynamicResource ExistPersonTemplate}" SelectedValuePath="Name" DockPanel.Dock="Top" Style="{DynamicResource ExistingPeopleListBoxStyle}" VirtualizingStackPanel.IsVirtualizing="True" ItemContainerStyle="{DynamicResource ExistingPeopleListBoxItemStyle}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" />
                        </DockPanel>

                        <Separator Grid.Row="1" Style="{DynamicResource DetailsSeparatorStyle}" />

                        <DockPanel Grid.Row="0">
                            <TextBlock Margin="15,5,5,5" Text="{x:Static properties:Resources.ConnectAFamilyMemberAs}" TextWrapping="Wrap" Style="{DynamicResource SectionHeaderStyle}" Foreground="{DynamicResource InputFontColor}" DockPanel.Dock="Top" FontWeight="Normal" />
                            <StackPanel Orientation="Horizontal" Margin="15,0,10,0" HorizontalAlignment="Left" DockPanel.Dock="Bottom">
                                <TextBlock TextTrimming="CharacterEllipsis" MaxWidth="130" MinWidth="130" Width="130" MaxHeight="22"  LineStackingStrategy="MaxHeight" Text="{Binding Path=FirstName, Converter={StaticResource FirstNamePossessiveFormConverter}, Mode=Default, FallbackValue=Name}" TextWrapping="NoWrap" Style="{DynamicResource HeaderStyle}" HorizontalAlignment="Left" FontSize="16" FontWeight="Bold" Margin="0,0,0,0" Foreground="{DynamicResource InputFontColor}" />
                                <ComboBox x:Name="ExistingFamilyMemberComboBox" ItemsSource="{Binding Source={StaticResource ExistingRelationshipValuesEnumDS}}" SelectionChanged="ExistingFamilyMemberComboBox_SelectionChanged" Width="110" Grid.Row="1" HorizontalAlignment="Left" Margin="5,0,0,0" Style="{DynamicResource FamilyMemberComboBox}" ItemTemplate="{DynamicResource ExistingFamilyMemberDataTemplate}" />
                            </StackPanel>
                        </DockPanel>

                        <Separator Grid.Row="3" Style="{DynamicResource DetailsSeparatorStyle}"/>

                        <StackPanel Grid.Row="4" Margin="15,0,15,5" Orientation="Horizontal">
                            <Button Content="{x:Static properties:Resources.Add}" x:Name="AddExistingButton" Height="15" VerticalAlignment="Top" FontSize="10" IsDefault="True" Width="Auto" MinWidth="60" Click="AddExistingButton_Click" Style="{DynamicResource RedButtonStyle}" />
                            <Button x:Name="CancelAddExistingButton" Content="{x:Static properties:Resources.Cancel}" VerticalAlignment="Top" FontSize="10" Height="15" IsCancel="True" Width="Auto" MinWidth="60" Margin="5,0,0,0" Click="CloseButton_Click" />
                        </StackPanel>

                    </Grid>
                </Border>

                <!-- Details Add Intermediate is displayed when additional input is needed when adding a person.  Currently, the choice for parent sets are shown when needed. -->
                <Border x:Name="DetailsAddIntermediate" DockPanel.Dock="Top" Style="{DynamicResource DetailsBorderStyle}" Margin="0,0,0,0" BorderThickness="0,1,0,1" CornerRadius="0,0,0,0" Padding="0,0,0,0" Background="{DynamicResource InputBackgroundBrush}" Visibility="Visible" Height="200">
                    <StackPanel>
                        <TextBlock Margin="15,5,5,5" Text="{x:Static properties:Resources.AddAFamilyMember}" TextWrapping="Wrap" Style="{DynamicResource SectionHeaderStyle}" Foreground="{DynamicResource InputFontColor}"/>
                        <StackPanel Orientation="Horizontal" Margin="15,0,10,0" HorizontalAlignment="Left" >
                            <TextBlock TextTrimming="CharacterEllipsis" MaxWidth="180" MaxHeight="22"  LineStackingStrategy="MaxHeight" Text="{Binding Path=FirstName, Converter={StaticResource FirstNamePossessiveFormConverter}, Mode=Default, FallbackValue=Name}" TextWrapping="Wrap" Style="{DynamicResource HeaderStyle}" HorizontalAlignment="Left" FontSize="18" FontWeight="Bold" Margin="0,0,0,0" Foreground="{DynamicResource InputFontColor}"/>
                            <TextBlock Text="{Binding Path=SelectedValue, ElementName=FamilyMemberComboBox, Mode=Default, FallbackValue=Relationship}" TextWrapping="Wrap" Style="{DynamicResource HeaderStyle}" HorizontalAlignment="Left" FontSize="18" FontWeight="Bold" Margin="0,0,0,0"/>
                        </StackPanel>
                        <Border Margin="10,5,10,0" BorderBrush="#FF6573A0" BorderThickness="0,2,0,0">
                            <StackPanel Margin="0,0,0,0">
                                <StackPanel Margin="5,0,5,0">
                                    <Label Content="{x:Static properties:Resources.WhoAreTheParents}" Target="{Binding ElementName=ParentsListBox, Mode=OneWay}" Foreground="{DynamicResource InputFontColor}"/>
                                    <ListBox MaxHeight="75" KeyboardNavigation.DirectionalNavigation="Cycle" BorderBrush="Transparent" x:Name="ParentsListBox" Foreground="{DynamicResource InputFontColor}" Background="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,-5,0,0" SelectionChanged="ParentsListBox_SelectionChanged" >
                                        <ListBox.Resources>
                                            <Style x:Key="{x:Type ListBoxItem}" TargetType="{x:Type ListBoxItem}" >
                                                <Setter Property="Margin" Value="2, 2, 2, 0" />
                                                <Setter Property="Template">
                                                    <Setter.Value>
                                                        <ControlTemplate>
                                                            <Border Background="Transparent">
                                                                <RadioButton IsHitTestVisible="False" Focusable="False" Foreground="{Binding Path=Foreground, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
                                             Content="{Binding Path=Name}"
                                             IsChecked="{Binding Path=IsSelected, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
                                                            </Border>
                                                        </ControlTemplate>
                                                    </Setter.Value>
                                                </Setter>
                                            </Style>
                                        </ListBox.Resources>
                                    </ListBox>
                                </StackPanel>
                                <Border Margin="0,10,0,0" BorderBrush="#FF6573A0" BorderThickness="0,2,0,0" Height="42">
                                    <StackPanel Margin="5,10,0,10" Orientation="Horizontal">
                                        <Button Content="{x:Static properties:Resources.Add}" x:Name="IntermediateAddButton" VerticalAlignment="Top" Height="15" FontSize="10" IsDefault="True" HorizontalAlignment="Left" Width="Auto" MinWidth="60" Click="IntermediateAddButton_Click" Style="{DynamicResource RedButtonStyle}"/>
                                        <Button x:Name="IntermediateCloseButton" VerticalAlignment="Top" Content="{x:Static properties:Resources.Cancel}" Height="15" FontSize="10" IsCancel="True" Width="Auto" MinWidth="60" Margin="5,0,0,0" Click="IntermediateCloseButton_Click" />
                                    </StackPanel>
                                </Border>
                            </StackPanel>
                        </Border>
                    </StackPanel>
                </Border>
                
                <!-- Details List shows the current list of all people in the family -->
                <Border x:Name="DetailsList" DockPanel.Dock="Top" Style="{DynamicResource DetailsBorderStyle}" Background="{x:Null}" BorderThickness="0,1,0,0" CornerRadius="0,0,0,0" Opacity="1" Margin="0,0,0,0" Padding="15,10,15,10">
                    <DockPanel>
                        <DockPanel Margin="0,0,0,8" DockPanel.Dock="Top">
                            <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{x:Static properties:Resources.FamilySpace}" Style="{DynamicResource SectionHeaderStyle}" Height="15" />
                            <TextBlock Text=" (" Style="{DynamicResource SectionHeaderStyle}" Height="15" />
                            <TextBlock Text="{Binding Path=Items.Count, ElementName=FamilyListView}" FontWeight="Normal" Style="{DynamicResource SectionHeaderStyle}" Height="15" />
                            <TextBlock Text=")" Style="{DynamicResource SectionHeaderStyle}" Height="15" />
                            </StackPanel>
                            <Button x:Name="FamilyDataButton" Content="{x:Static properties:Resources.FamilyData}" Style="{DynamicResource BlackButtonStyle}" Click="FamiliyDataButton_Click" HorizontalAlignment="Right" Width="Auto" MinWidth="80"/>
                        </DockPanel>
                        <DockPanel HorizontalAlignment="Stretch" DockPanel.Dock="Top">
                            <Label Margin="0,0,5,5" Content="{x:Static properties:Resources.Filter}" VerticalAlignment="Center"/>
                            <local:FilterText x:Name="FilterTextBox" TextBoxBase.TextChanged="FilterTextBox_TextChanged" VerticalAlignment="Center" Margin="0,0,0,0" />
                        </DockPanel>
                        <local:FamilyDisplayListView x:Name="FamilyListView" Background="{x:Null}" Margin="0,5,0,0" BorderBrush="{x:Null}"
          		SelectionMode="Single" SelectionChanged="FamilyListView_SelectionChanged" ScrollViewer.HorizontalScrollBarVisibility="Disabled" 
          		Style="{DynamicResource FamilyListViewStyle}" ScrollViewer.VerticalScrollBarVisibility="Auto"
          		VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling" >
                            <local:FamilyDisplayListView.ItemContainerStyle>
                                <Style TargetType="{x:Type ListViewItem}" >
                                    <Setter Property="Template" Value="{DynamicResource FamilyListViewItemTemplate}"/>
                                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                                </Style>
                            </local:FamilyDisplayListView.ItemContainerStyle>
                            <local:FamilyDisplayListView.View>
                                <GridView AllowsColumnReorder="False">
                                    <local:SortListViewColumn SortProperty="Name"  Header="{x:Static properties:Resources.Name}" DisplayMemberBinding="{Binding Path=Name}" Width="128" HeaderContainerStyle="{DynamicResource NameGridViewColumnHeader}"/>
                                    <local:SortListViewColumn SortProperty="BirthDate" Header="{x:Static properties:Resources.Born}" Width="35">
                                        <local:SortListViewColumn.CellTemplate>
                                            <DataTemplate>
                                                <TextBlock HorizontalAlignment="Left" Text="{Binding Path=YearOfBirth}" Foreground="{DynamicResource FontColor}" />
                                            </DataTemplate>
                                        </local:SortListViewColumn.CellTemplate>
                                    </local:SortListViewColumn>
                                    <local:SortListViewColumn SortProperty="DeathDate"  Header="{x:Static properties:Resources.Died}" Width="35">
                                        <local:SortListViewColumn.CellTemplate>
                                            <DataTemplate>
                                                <TextBlock HorizontalAlignment="Left" Text="{Binding Path=YearOfDeath}" Foreground="{DynamicResource FontColor}" />
                                            </DataTemplate>
                                        </local:SortListViewColumn.CellTemplate>
                                    </local:SortListViewColumn>
                                    <local:SortListViewColumn SortProperty="Age"  Header="{x:Static properties:Resources.Age}" Width="30">
                                        <local:SortListViewColumn.CellTemplate>
                                            <DataTemplate>
                                                <TextBlock HorizontalAlignment="Left" Text="{Binding Path=Age}" Foreground="{DynamicResource FontColor}" />
                                            </DataTemplate>
                                        </local:SortListViewColumn.CellTemplate>
                                    </local:SortListViewColumn>
                                </GridView>
                            </local:FamilyDisplayListView.View>
                        </local:FamilyDisplayListView>
                    </DockPanel>
                </Border>
            </DockPanel>
        </Border>
       
    </DockPanel>
</UserControl>
